]> sjero.net Git - wget/commitdiff
[svn] Document the side effect of test_socket_open.
authorhniksic <devnull@localhost>
Sat, 2 Jul 2005 13:22:13 +0000 (06:22 -0700)
committerhniksic <devnull@localhost>
Sat, 2 Jul 2005 13:22:13 +0000 (06:22 -0700)
src/http.c

index 61819c7fc15d8e4c668c93ac57e593e54be5ecc8..7aaa499b8ccf9c7ad3e363f61e02a8c7ae0e5c26 100644 (file)
@@ -1009,11 +1009,17 @@ persistent_available_p (const char *host, int port, bool ssl,
     }
 
   /* Finally, check whether the connection is still open.  This is
-     important because most server implement a liberal (short) timeout
+     important because most servers implement liberal (short) timeout
      on persistent connections.  Wget can of course always reconnect
      if the connection doesn't work out, but it's nicer to know in
      advance.  This test is a logical followup of the first test, but
-     is "expensive" and therefore placed at the end of the list.  */
+     is "expensive" and therefore placed at the end of the list.
+
+     (Current implementation of test_socket_open has a nice side
+     effect that it treats sockets with pending data as "closed".
+     This is exactly what we want: if a broken server sends message
+     body in response to HEAD, or if it sends more than conent-length
+     data, we won't reuse the corrupted connection.)  */
 
   if (!test_socket_open (pconn.socket))
     {