Blame SOURCES/wget-1.14-set_sock_to_-1_if_no_persistent_conn.patch

bc22e6
From 8760123cee87e07a276b8b13ef48ada3a490ad47 Mon Sep 17 00:00:00 2001
bc22e6
From: Tomas Hozza <thozza@redhat.com>
bc22e6
Date: Thu, 11 Jul 2013 11:22:43 +0000
bc22e6
Subject: Set sock variable to -1 if no persistent conn exists
bc22e6
bc22e6
Wget should set sock variable to -1 if no persistent
bc22e6
connection exists. Function persistent_available_p()
bc22e6
tests persistent connection but if test_socket_open()
bc22e6
fails it closes the socket but will not set sock variable
bc22e6
to -1. After returning from persistent_available_p()
bc22e6
it is possible that sock has still value of already
bc22e6
closed connection.
bc22e6
bc22e6
Signed-off-by: Tomas Hozza <thozza@redhat.com>
bc22e6
---
bc22e6
diff --git a/src/http.c b/src/http.c
bc22e6
index 669f0fe..a693355 100644
bc22e6
--- a/src/http.c
bc22e6
+++ b/src/http.c
bc22e6
@@ -1983,6 +1983,10 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy,
bc22e6
                     exec_name, quote (relevant->host));
bc22e6
           return HOSTERR;
bc22e6
         }
bc22e6
+      else if (sock != -1)
bc22e6
+        {
bc22e6
+          sock = -1;
bc22e6
+        }
bc22e6
     }
bc22e6
 
bc22e6
   if (sock < 0)
bc22e6
--
bc22e6
cgit v0.9.0.2