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

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