Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(529)

Unified Diff: net/base/elements_upload_data_stream.cc

Issue 2030353002: UploadDataStream now returns errors on failures (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments in the header Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/base/upload_data_stream.h » ('j') | net/base/upload_data_stream.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
« no previous file with comments | « no previous file | net/base/upload_data_stream.h » ('j') | net/base/upload_data_stream.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698