aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2017-12-07 16:42:47 -0500
committerJack Lloyd <[email protected]>2017-12-07 16:42:47 -0500
commit968d2a5fcdd9c6e2943eabbd67eb6372c1b62d77 (patch)
tree76d8ef20ae653956a33f0700f9d7a4b3d2b2459d /src
parentb2ea1923e2f8d7b1d45f9362cb279ad9342191dc (diff)
Avoid saving a resumed session multiple times
Diffstat (limited to 'src')
-rw-r--r--src/lib/tls/tls_client.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/tls/tls_client.cpp b/src/lib/tls/tls_client.cpp
index ed3821ed2..631779e99 100644
--- a/src/lib/tls/tls_client.cpp
+++ b/src/lib/tls/tls_client.cpp
@@ -33,6 +33,8 @@ class Client_Handshake_State final : public Handshake_State
return *server_public_key.get();
}
+ bool is_a_resumption() const { return (resume_master_secret.empty() == false); }
+
std::unique_ptr<Public_Key> server_public_key;
// Used during session resumption
@@ -620,7 +622,7 @@ void Client::process_handshake_msg(const Handshake_State* active_state,
const bool should_save = save_session(session_info);
- if(!session_id.empty())
+ if(session_id.size() > 0 && state.is_a_resumption() == false)
{
if(should_save)
session_manager().save(session_info);