diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs index 98718f8..8475693 100644 --- a/src/main.rs +++ b/src/main.rs @@ -214,10 +214,11 @@ fn check_connectivity( }; if let Some(mut conn4) = conn4 { - conn4.write_all(b"GET / HTTP/1.1")?; conn4.set_read_timeout(Some(TCP_TIMEOUT))?; conn4.set_write_timeout(Some(TCP_TIMEOUT))?; + conn4.write_all(b"GET / HTTP/1.1\n\n").ok(); + loop { match conn4.read(&mut buf) { Ok(0) => { @@ -250,10 +251,11 @@ fn check_connectivity( }; if let Some(mut conn6) = conn6 { - conn6.write_all(b"GET / HTTP/1.1")?; conn6.set_read_timeout(Some(TCP_TIMEOUT))?; conn6.set_write_timeout(Some(TCP_TIMEOUT))?; + conn6.write_all(b"GET / HTTP/1.1\n\n").ok(); + loop { match conn6.read(&mut buf) { Ok(0) => { |