From: Neel Goyal Date: Thu, 15 Sep 2016 19:00:17 +0000 (-0700) Subject: Add flag to indicate a session resumption attempt X-Git-Tag: v2016.09.19.00~8 X-Git-Url: http://plrg.eecs.uci.edu/git/?p=folly.git;a=commitdiff_plain;h=fd03201905c42cab89332187c5ba8d6e25154de2 Add flag to indicate a session resumption attempt Summary: Track when session resumption was attempted during connect Reviewed By: shamdor-fb Differential Revision: D3861028 fbshipit-source-id: 26ca41084faeeb64666b6833896b9510ef2b4c25 --- diff --git a/folly/io/async/AsyncSSLSocket.cpp b/folly/io/async/AsyncSSLSocket.cpp index a7167989..8175f8a5 100644 --- a/folly/io/async/AsyncSSLSocket.cpp +++ b/folly/io/async/AsyncSSLSocket.cpp @@ -757,6 +757,7 @@ void AsyncSSLSocket::sslConn(HandshakeCB* callback, uint64_t timeout, applyVerificationOptions(ssl_); if (sslSession_ != nullptr) { + sessionResumptionAttempted_ = true; SSL_set_session(ssl_, sslSession_); SSL_SESSION_free(sslSession_); sslSession_ = nullptr; diff --git a/folly/io/async/AsyncSSLSocket.h b/folly/io/async/AsyncSSLSocket.h index 47ad97b0..2e09935c 100644 --- a/folly/io/async/AsyncSSLSocket.h +++ b/folly/io/async/AsyncSSLSocket.h @@ -741,6 +741,10 @@ class AsyncSSLSocket : public virtual AsyncSocket { return certCacheHit_; } + bool sessionResumptionAttempted() const { + return sessionResumptionAttempted_; + } + private: void init(); @@ -895,6 +899,7 @@ class AsyncSSLSocket : public virtual AsyncSocket { std::chrono::steady_clock::time_point handshakeStartTime_; std::chrono::steady_clock::time_point handshakeEndTime_; uint64_t handshakeConnectTimeout_{0}; + bool sessionResumptionAttempted_{false}; }; } // namespace