| Index: net/http/http_stream_parser.cc
|
| diff --git a/net/http/http_stream_parser.cc b/net/http/http_stream_parser.cc
|
| index c6b87e26a21984dd0450e597e44be31906904a6f..f49721638c0be2ebb8c757a2cccf263a4696a11d 100644
|
| --- a/net/http/http_stream_parser.cc
|
| +++ b/net/http/http_stream_parser.cc
|
| @@ -274,7 +274,6 @@ int HttpStreamParser::SendRequest(const std::string& request_line,
|
| }
|
|
|
| io_state_ = STATE_SEND_HEADERS;
|
| -
|
| // If we have a small request body, then we'll merge with the headers into a
|
| // single write.
|
| bool did_merge = false;
|
| @@ -287,7 +286,6 @@ int HttpStreamParser::SendRequest(const std::string& request_line,
|
| // body.
|
| request_headers_ = new DrainableIOBuffer(
|
| merged_request_headers_and_body.get(), merged_size);
|
| -
|
| memcpy(request_headers_->data(), request.data(), request_headers_length_);
|
| request_headers_->DidConsume(request_headers_length_);
|
|
|
| @@ -295,7 +293,8 @@ int HttpStreamParser::SendRequest(const std::string& request_line,
|
| while (todo) {
|
| int consumed = request_->upload_data_stream->Read(
|
| request_headers_.get(), static_cast<int>(todo), CompletionCallback());
|
| - DCHECK_GT(consumed, 0); // Read() won't fail if not chunked.
|
| + // Read() must succeed synchronously if not chunked and in memory.
|
| + DCHECK_GT(consumed, 0);
|
| request_headers_->DidConsume(consumed);
|
| todo -= consumed;
|
| }
|
| @@ -550,7 +549,8 @@ int HttpStreamParser::DoSendBodyComplete(int result) {
|
| int HttpStreamParser::DoSendRequestReadBodyComplete(int result) {
|
| // |result| is the result of read from the request body from the last call to
|
| // DoSendBody().
|
| - DCHECK_GE(result, 0); // There won't be errors.
|
| + if (result < 0)
|
| + return result;
|
|
|
| // Chunked data needs to be encoded.
|
| if (request_->upload_data_stream->is_chunked()) {
|
|
|