Skip to content

Commit

Permalink
quic: Fix HTTP/3 Fast CONNECT behavior
Browse files Browse the repository at this point in the history
SpdyProxyClientSocket uses read_callback_ for both Connect() and
Read(), and its OnIOComplete() calls read_callback_, thus its fast
connect code checks read_callback_. The code was ported to
QuicProxyClientSocket without much change.

But QuicProxyClientSocket uses a separate connect_callback_ apart from
read_callback_, and its OnIOComplete() calls connect_callback_, thus
when headers are received after Connect() it doesn't need to check
read_callback_ and should always avoid calling connect_callback_.
  • Loading branch information
klzgrad committed Apr 7, 2019
1 parent 035a725 commit fcbc4ac
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/net/quic/quic_proxy_client_socket.cc
Original file line number Diff line number Diff line change
Expand Up @@ -316,16 +316,12 @@ int QuicProxyClientSocket::DoLoop(int last_io_result) {
if (use_fastopen_ && read_headers_pending_) {
read_headers_pending_ = false;
if (rv < 0) {
// read_callback_ cannot be called.
if (!read_callback_)
rv = ERR_IO_PENDING;
// read_callback_ will be called with this error and be reset.
// Further data after that will be ignored.
next_state_ = STATE_DISCONNECTED;
} else {
// Does not call read_callback_ from here if headers are OK.
rv = ERR_IO_PENDING;
}
// Prevents calling connect_callback_.
rv = ERR_IO_PENDING;
}
break;
default:
Expand Down

0 comments on commit fcbc4ac

Please sign in to comment.