T. Bharath's comments about SSL cleanup incorporated, and the two new

curl_global_* functions
This commit is contained in:
Daniel Stenberg
2001-05-28 14:12:43 +00:00
parent a9d0a85842
commit d300cf4d84
4 changed files with 64 additions and 7 deletions

View File

@@ -833,6 +833,17 @@ CURLcode Curl_disconnect(struct connectdata *conn)
#ifdef USE_SSLEAY
if (conn->ssl.use) {
/*
ERR_remove_state() frees the error queue associated with
thread pid. If pid == 0, the current thread will have its
error queue removed.
Since error queue data structures are allocated
automatically for new threads, they must be freed when
threads are terminated in oder to avoid memory leaks.
*/
ERR_remove_state(0);
if(conn->ssl.handle) {
(void)SSL_shutdown(conn->ssl.handle);
SSL_set_connect_state(conn->ssl.handle);