Commit 893b8126 authored by mmenke's avatar mmenke Committed by Commit bot

Remove a DCHECK on ClientSocketHandle state from proxy code.

This was causing issues for one of our fuzzers.

The DCHECK made sure the ClientSocketHandle was initialized, which was
not the state in tests. Normally, handles set initialized to true
when they are assigned a socket, and the connection callback is invoked.
When the Handle is torn down, if the Handle was initialized, the socket
is returned to the socket pool.  A lot of tests bypass all this, not
using socket pools at all, and just assigning a socket to the
SocketHandle. This results in is_connected being false, which was
triggering the DCHECK.

We could instead make sure that is_initialized is set to true in tests,
but this has minimal value - in production, it's set to true if and only
if a socket is set and the callback invoked, and set to false only when
the socket is destroyed or returned to the socket pool. If the socket is
null, we'll crash very soon with an equally useful crash stack, anyways.
In production, if the connection callback wasn't invoked, the
HttpProxyClientSocket's state machine will catch the issue, anyways.

BUG=632608

Review-Url: https://codereview.chromium.org/2192193002
Cr-Commit-Position: refs/heads/master@{#408670}
parent e1a19024
...@@ -511,7 +511,6 @@ int HttpProxyClientSocket::DoReadHeadersComplete(int result) { ...@@ -511,7 +511,6 @@ int HttpProxyClientSocket::DoReadHeadersComplete(int result) {
int HttpProxyClientSocket::DoDrainBody() { int HttpProxyClientSocket::DoDrainBody() {
DCHECK(drain_buf_.get()); DCHECK(drain_buf_.get());
DCHECK(transport_->is_initialized());
next_state_ = STATE_DRAIN_BODY_COMPLETE; next_state_ = STATE_DRAIN_BODY_COMPLETE;
return http_stream_parser_->ReadResponseBody( return http_stream_parser_->ReadResponseBody(
drain_buf_.get(), kDrainBodyBufferSize, io_callback_); drain_buf_.get(), kDrainBodyBufferSize, io_callback_);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment