From: hno <> Date: Mon, 18 Aug 2003 18:24:45 +0000 (+0000) Subject: Non-intrusive but significant performance improvement when Squid is running X-Git-Tag: SQUID_3_0_PRE4~1245 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f38c5e439d4d631d28a5858bbd3661c6ded0e8a9;p=thirdparty%2Fsquid.git Non-intrusive but significant performance improvement when Squid is running as a https reverse proxy (ssl enabled peers), allowing Squid to reuse the same SSL session. --- diff --git a/src/forward.cc b/src/forward.cc index 519bc9f96a..b62a9d31be 100644 --- a/src/forward.cc +++ b/src/forward.cc @@ -1,6 +1,6 @@ /* - * $Id: forward.cc,v 1.111 2003/08/16 20:33:47 hno Exp $ + * $Id: forward.cc,v 1.112 2003/08/18 12:24:45 hno Exp $ * * DEBUG: section 17 Request Forwarding * AUTHOR: Duane Wessels @@ -314,6 +314,13 @@ fwdNegotiateSSL(int fd, void *data) } } + if (fs->_peer && !SSL_session_reused(ssl)) { + if (fs->_peer->sslSession) + SSL_SESSION_free(fs->_peer->sslSession); + + fs->_peer->sslSession = SSL_get1_session(ssl); + } + fwdDispatch(fwdState); } @@ -362,6 +369,10 @@ fwdInitiateSSL(FwdState * fwdState) else SSL_set_ex_data(ssl, ssl_ex_index_server, peer->host); + + if (peer->sslSession) + SSL_set_session(ssl, peer->sslSession); + } else { SSL_set_ex_data(ssl, ssl_ex_index_server, fwdState->request->host); } diff --git a/src/structs.h b/src/structs.h index 94948fb05a..4b31b62671 100644 --- a/src/structs.h +++ b/src/structs.h @@ -1,6 +1,6 @@ /* - * $Id: structs.h,v 1.479 2003/08/13 00:17:26 robertc Exp $ + * $Id: structs.h,v 1.480 2003/08/18 12:24:45 hno Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -1383,6 +1383,7 @@ unsigned int counting: char *sslflags; char *ssldomain; SSL_CTX *sslContext; + SSL_SESSION *sslSession; #endif int front_end_https;