summaryrefslogtreecommitdiffstats
path: root/net/http/http_stream_parser.cc
diff options
context:
space:
mode:
Diffstat (limited to 'net/http/http_stream_parser.cc')
-rw-r--r--net/http/http_stream_parser.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/net/http/http_stream_parser.cc b/net/http/http_stream_parser.cc
index a83616b..abbf112 100644
--- a/net/http/http_stream_parser.cc
+++ b/net/http/http_stream_parser.cc
@@ -62,10 +62,15 @@ int HttpStreamParser::SendRequest(const HttpRequestInfo* request,
}
int HttpStreamParser::ReadResponseHeaders(CompletionCallback* callback) {
- DCHECK_EQ(STATE_REQUEST_SENT, io_state_);
+ DCHECK(io_state_ == STATE_REQUEST_SENT || io_state_ == STATE_DONE);
DCHECK(!user_callback_);
DCHECK(callback);
+ // This function can be called with io_state_ == STATE_DONE if the
+ // connection is closed after seeing just a 1xx response code.
+ if (io_state_ == STATE_DONE)
+ return ERR_CONNECTION_CLOSED;
+
int result = OK;
io_state_ = STATE_READ_HEADERS;