]> sjero.net Git - wget/commitdiff
[svn] Don't forget to shutdown the SSL structure if the socket times out.
authorhniksic <devnull@localhost>
Fri, 30 Nov 2001 08:57:03 +0000 (00:57 -0800)
committerhniksic <devnull@localhost>
Fri, 30 Nov 2001 08:57:03 +0000 (00:57 -0800)
Submitted by T. Bharath in <3B3DEBC7.2537186A@responsenetworks.com>.

src/ChangeLog
src/http.c

index 15c0db948f25eb905677c235f64dcee0b8ef9d90..47a852a28ca8b48514c7c426e57d04d4d1a19930 100644 (file)
@@ -1,3 +1,8 @@
+2001-11-30  T. Bharath  <TBharath@responsenetworks.com>
+
+       * http.c (persistent_available_p): Call SHUTDOWN_SSL if
+       test_socket_open fails.
+
 2001-11-30  Hrvoje Niksic  <hniksic@arsdigita.com>
 
        * progress.c (display_image): Just print one CR to reset the
index 9043527ac947e0da8995cefbc5f6ea4573a61493..500e4b9fbc32a9afa6bbdf803795ffe20caabecb 100644 (file)
@@ -374,6 +374,15 @@ register_persistent (const char *host, unsigned short port, int fd
   DEBUGP (("Registered fd %d for persistent reuse.\n", fd));
 }
 
+#ifdef HAVE_SSL
+# define SHUTDOWN_SSL(ssl) do {                \
+  if (ssl)                             \
+    shutdown_ssl (ssl);                        \
+} while (0)
+#else
+# define SHUTDOWN_SSL(ssl) 
+#endif
+
 /* Return non-zero if a persistent connection is available for
    connecting to HOST:PORT.  */
 
@@ -429,21 +438,16 @@ persistent_available_p (const char *host, unsigned short port
          let's invalidate the persistent connection before returning
          0.  */
       CLOSE (pc_last_fd);
+#ifdef HAVE_SSL
+      SHUTDOWN_SSL (pc_last_ssl);
+      pc_last_ssl = NULL;
+#endif
       invalidate_persistent ();
       return 0;
     }
   return 1;
 }
 
-#ifdef HAVE_SSL
-# define SHUTDOWN_SSL(ssl) do {                \
-  if (ssl)                             \
-    shutdown_ssl (ssl);                        \
-} while (0)
-#else
-# define SHUTDOWN_SSL(ssl) 
-#endif
-
 /* The idea behind these two CLOSE macros is to distinguish between
    two cases: one when the job we've been doing is finished, and we
    want to close the connection and leave, and two when something is