Branched disucssion from https://codereview.chromium.org/2766603004.
xunjieli@ suggests a change QuicCryptoClientStream::CryptoConnect API to make the API contract clearer as the current signature doesn't indicate that it can return error synchronously. crbug.com/700617 is caused by failing to handle the sync error in this code.
int QuicChromiumClientSession::CryptoConnect(
const CompletionCallback& callback) {
connect_timing_.connect_start = base::TimeTicks::Now();
RecordHandshakeState(STATE_STARTED);
DCHECK(flow_controller());
crypto_stream_->CryptoConnect(); <------- doesn't indicate could fail synchronously.
if (IsCryptoHandshakeConfirmed()) {
connect_timing_.connect_end = base::TimeTicks::Now();
return OK;
}
// Unless we require handshake confirmation, activate the session if
// we have established initial encryption.
if (!require_confirmation_ && IsEncryptionEstablished())
return OK;
callback_ = callback;
return ERR_IO_PENDING;
}
Comment 1 by rch@chromium.org
, Mar 23 2017