Simplify TFO write path
Summary: We currently call handleInitialReadWrite. The reason for this is that if the read callback was set before TFO was done with connecting, then we need to call handleinitialreadwrite to setup the read callback similar to how connect invokes handleInitialReadWrite after it's done. However handleinitalreadwrite may also call handleWrite if writeReqHead_ is non null. Practically this will not happen since TFO will happen on the first write only where writeReqHead_ will be null. The current code path though is a little bit complicated. This simplfies the code so that we dont need to potentially call handleWrite within a write call. We schedule the initial readwrite call asynchrously. The reason for this is that handleReadWrite can actually fail if updating events fails. This might cause weird state issues once it returns and we have no mechanism of processing it. Reviewed By: djwatson Differential Revision: D3695925 fbshipit-source-id: 72e19a9e1802caa14e872e05a5cd9bf4e34c5e7d
Showing
Please register or sign in to comment