Invoking correct callback during TFO fallback
authorSubodh Iyengar <subodh@fb.com>
Wed, 17 Aug 2016 04:52:13 +0000 (21:52 -0700)
committerFacebook Github Bot 2 <facebook-github-bot-2-bot@fb.com>
Wed, 17 Aug 2016 04:53:42 +0000 (21:53 -0700)
commit12ace86198d5050388099abb0cdb58faa7d4ac74
treec2695523d9e8dfbd7cd3511128459bcbe0bf22b6
parent457fa717520ff97cd5dfbbb136cbca6c1d50de12
Invoking correct callback during TFO fallback

Summary:
If we fallback from SSL to TFO and the connection times
out, invokeConnectSuccess tries to deliver the connectError,
however we've already delivered the connect callback to the user.

This is bad because we have no way of reporting an error back.
This changes it so that when using SSL and we're scheduling a timeout
when we're falling back, we will schedule a timeout of our own which
will invoke AsyncSSLSocket's timeoutExpired. This will return a handshakeError
instead to the client.

Reviewed By: yfeldblum

Differential Revision: D3708699

fbshipit-source-id: 41fe668f00972c0875bb0318c6a6de863d3ab8f9
folly/io/async/AsyncSSLSocket.cpp
folly/io/async/AsyncSSLSocket.h
folly/io/async/AsyncSocket.cpp
folly/io/async/AsyncSocket.h
folly/io/async/test/AsyncSSLSocketTest.cpp