Index: net/base/elements_upload_data_stream.cc |
diff --git a/net/base/elements_upload_data_stream.cc b/net/base/elements_upload_data_stream.cc |
index bca7d4e7aab0ac1dc2b5d5c019100a8bdff23660..59c48d70fe9d9dce84984890366505ea29519390 100644 |
--- a/net/base/elements_upload_data_stream.cc |
+++ b/net/base/elements_upload_data_stream.cc |
@@ -125,16 +125,8 @@ int ElementsUploadDataStream::ReadElements( |
ProcessReadResult(buf, result); |
} |
- if (read_failed_) { |
- // If an error occured during read operation, then pad with zero. |
- // Otherwise the server will hang waiting for the rest of the data. |
- int num_bytes_to_fill = |
- static_cast<int>(std::min(static_cast<uint64_t>(buf->BytesRemaining()), |
- size() - position() - buf->BytesConsumed())); |
- DCHECK_GE(num_bytes_to_fill, 0); |
- memset(buf->data(), 0, num_bytes_to_fill); |
- buf->DidConsume(num_bytes_to_fill); |
- } |
+ if (read_failed_) |
+ return ERR_FAILED; |
return buf->BytesConsumed(); |
} |