Add flag to indicate a session resumption attempt
authorNeel Goyal <ngoyal@fb.com>
Thu, 15 Sep 2016 19:00:17 +0000 (12:00 -0700)
committerFacebook Github Bot 2 <facebook-github-bot-2-bot@fb.com>
Thu, 15 Sep 2016 19:08:42 +0000 (12:08 -0700)
Summary: Track when session resumption was attempted during connect

Reviewed By: shamdor-fb

Differential Revision: D3861028

fbshipit-source-id: 26ca41084faeeb64666b6833896b9510ef2b4c25

folly/io/async/AsyncSSLSocket.cpp
folly/io/async/AsyncSSLSocket.h

index a7167989505714fa2a0087e65a864154a4f504c7..8175f8a5ac9157a3b31d8700abbe5abff206a82e 100644 (file)
@@ -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;
index 47ad97b08160279e9c9419eaa9a97a2a164688a0..2e09935c0de5f5048989b8cfe06df6b3ba92b85d 100644 (file)
@@ -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