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

Unified Diff: net/base/upload_data_stream.cc

Issue 2007013003: Introduce error handling in HttpStreamParser on UploadDataStream::Read() failure. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: added upload_data_stream.cc/h in order to be able to land the cl 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 | « net/base/upload_data_stream.h ('k') | net/http/http_stream_parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/upload_data_stream.cc
diff --git a/net/base/upload_data_stream.cc b/net/base/upload_data_stream.cc
index a7542778ff5a0bf93968eca29888c835bfa3f6e8..37e19aed313d210d622ab495643191020a0a63eb 100644
--- a/net/base/upload_data_stream.cc
+++ b/net/base/upload_data_stream.cc
@@ -109,18 +109,19 @@ void UploadDataStream::OnInitCompleted(int result) {
}
void UploadDataStream::OnReadCompleted(int result) {
- DCHECK_GE(result, 0);
DCHECK(initialized_successfully_);
+ DCHECK(result != 0 || is_eof_);
+ DCHECK_NE(ERR_IO_PENDING, result);
- current_position_ += result;
- if (!is_chunked_) {
- DCHECK_LE(current_position_, total_size_);
- if (current_position_ == total_size_)
- is_eof_ = true;
+ if (result > 0) {
+ current_position_ += result;
+ if (!is_chunked_) {
+ DCHECK_LE(current_position_, total_size_);
+ if (current_position_ == total_size_)
+ is_eof_ = true;
+ }
}
- DCHECK(result > 0 || is_eof_);
-
if (!callback_.is_null())
base::ResetAndReturn(&callback_).Run(result);
}
« no previous file with comments | « net/base/upload_data_stream.h ('k') | net/http/http_stream_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698