1
0
mirror of https://github.com/moparisthebest/wget synced 2024-07-03 16:38:41 -04:00

[svn] Don't forget to shutdown the SSL structure if the socket times out.

Submitted by T. Bharath in <3B3DEBC7.2537186A@responsenetworks.com>.
This commit is contained in:
hniksic 2001-11-30 00:57:03 -08:00
parent b4b0659e43
commit 2c37aef2d8
2 changed files with 18 additions and 9 deletions

View 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

View 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