From d26a38062032139ec50f0eda418b2fe73b319d61 Mon Sep 17 00:00:00 2001 From: Kyle Nekritz Date: Mon, 5 Oct 2015 13:28:42 -0700 Subject: [PATCH] Check if handshake timeout is set in AsyncSSLSocket::isDetachable(). Summary: If it is, return false. Reviewed By: @siyengar Differential Revision: D2503765 fb-gh-sync-id: 36b5e2e8cabc2a5157735637be6ca3414005da81 --- folly/io/async/AsyncSSLSocket.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/folly/io/async/AsyncSSLSocket.h b/folly/io/async/AsyncSSLSocket.h index 6fead846..dd328703 100644 --- a/folly/io/async/AsyncSSLSocket.h +++ b/folly/io/async/AsyncSSLSocket.h @@ -323,10 +323,10 @@ class AsyncSSLSocket : public virtual AsyncSocket { /** * Initiate an SSL connection on the socket - * THe callback will be invoked and uninstalled when an SSL connection + * The callback will be invoked and uninstalled when an SSL connection * has been establshed on the underlying socket. - * The verification option verifyPeer is applied if its passed explicitly. - * If its not, the options in SSLContext set on the underying SSLContext + * The verification option verifyPeer is applied if it's passed explicitly. + * If it's not, the options in SSLContext set on the underlying SSLContext * are applied. * * @param callback callback object to invoke on success/failure @@ -488,6 +488,10 @@ class AsyncSSLSocket : public virtual AsyncSocket { handshakeTimeout_.detachEventBase(); } + virtual bool isDetachable() const override { + return AsyncSocket::isDetachable() && !handshakeTimeout_.isScheduled(); + } + virtual void attachTimeoutManager(TimeoutManager* manager) { handshakeTimeout_.attachTimeoutManager(manager); } -- 2.34.1