diff options
author | Jay Satiro <raysatiro@yahoo.com> | 2016-06-12 23:47:12 -0400 |
---|---|---|
committer | Jay Satiro <raysatiro@yahoo.com> | 2016-06-22 02:33:29 -0400 |
commit | 04b4ee5498b14d320e3b375c64d0162cc2b53c99 (patch) | |
tree | 8b9c10dfced26473f014bd8bcf37296237f35e2a /lib/vtls/vtls.c | |
parent | 046c2c85c4c365d4ae8a621d7886caf96f51e0e7 (diff) |
vtls: Only call add/getsession if session id is enabled
Prior to this change we called Curl_ssl_getsessionid and
Curl_ssl_addsessionid regardless of whether session ID reusing was
enabled. According to comments that is in case session ID reuse was
disabled but then later enabled.
The old way was not intuitive and probably not something users expected.
When a user disables session ID caching I'd guess they don't expect the
session ID to be cached anyway in case the caching is later enabled.
Diffstat (limited to 'lib/vtls/vtls.c')
-rw-r--r-- | lib/vtls/vtls.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/vtls/vtls.c b/lib/vtls/vtls.c index 6a7c1ace6..fa79f5ba4 100644 --- a/lib/vtls/vtls.c +++ b/lib/vtls/vtls.c @@ -364,6 +364,8 @@ bool Curl_ssl_getsessionid(struct connectdata *conn, *ssl_sessionid = NULL; + DEBUGASSERT(conn->ssl_config.sessionid); + if(!conn->ssl_config.sessionid) /* session ID re-use is disabled */ return TRUE; @@ -460,9 +462,7 @@ CURLcode Curl_ssl_addsessionid(struct connectdata *conn, int conn_to_port; long *general_age; - /* Even though session ID re-use might be disabled, that only disables USING - IT. We still store it here in case the re-using is again enabled for an - upcoming transfer */ + DEBUGASSERT(conn->ssl_config.sessionid); clone_host = strdup(conn->host.name); if(!clone_host) |