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