From 79a8def8c8dda4ec1a0fdd5f5ea5e71f461d5dd7 Mon Sep 17 00:00:00 2001 From: hniksic Date: Sat, 2 Jul 2005 06:22:13 -0700 Subject: [PATCH] [svn] Document the side effect of test_socket_open. --- src/http.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/http.c b/src/http.c index 61819c7f..7aaa499b 100644 --- a/src/http.c +++ b/src/http.c @@ -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)) {