From 3c52c53dddd3193d20bcb6fb335b1813eb1c07dd Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 28 Aug 2001 08:37:54 +0000 Subject: Added SSL session ID caching, moved some SSL code from url.c to ssluse.c --- lib/url.c | 34 +++++++++------------------------- 1 file changed, 9 insertions(+), 25 deletions(-) (limited to 'lib/url.c') diff --git a/lib/url.c b/lib/url.c index 66eedf473..294a5db9b 100644 --- a/lib/url.c +++ b/lib/url.c @@ -148,6 +148,11 @@ CURLcode Curl_close(struct UrlData *data) /* Loop through all open connections and kill them one by one */ while(-1 != ConnectionKillOne(data)); +#ifdef USE_SSLEAY + /* Close down all open info open SSL and sessions */ + Curl_SSL_Close_All(data); +#endif + if(data->bits.proxystringalloc) { data->bits.proxystringalloc=FALSE;; free(data->proxy); @@ -242,6 +247,9 @@ CURLcode Curl_open(struct UrlData **curl) data->bits.hide_progress = TRUE; /* CURLOPT_NOPROGRESS changes these */ data->progress.flags |= PGRS_HIDE; + /* Set the default size of the SSL session ID cache */ + data->ssl.numsessions = 5; + /* create an array with connection data struct pointers */ data->numconnects = 5; /* hard-coded right now */ data->connects = (struct connectdata **) @@ -875,31 +883,7 @@ CURLcode Curl_disconnect(struct connectdata *conn) free(conn->path); #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); - - SSL_free (conn->ssl.handle); - conn->ssl.handle = NULL; - } - if(conn->ssl.ctx) { - SSL_CTX_free (conn->ssl.ctx); - conn->ssl.ctx = NULL; - } - conn->ssl.use = FALSE; /* get back to ordinary socket usage */ - } + Curl_SSL_Close(conn); #endif /* USE_SSLEAY */ /* close possibly still open sockets */ -- cgit v1.2.3