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

Unified Diff: net/spdy/spdy_http_stream.cc

Issue 2022053002: Introduce error handling in SpdyHttpStream on UploadDataStream::Read() failure. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments + moving ReadErrorUploadDataStream back to unnamed naspace 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/spdy/spdy_http_stream.h ('k') | net/spdy/spdy_http_stream_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_http_stream.cc
diff --git a/net/spdy/spdy_http_stream.cc b/net/spdy/spdy_http_stream.cc
index fa64954996fccc7ff5423839667cbcd98dfb9cf8..ea5be19c72b47831c4b5a02ffb0da9906ca91439 100644
--- a/net/spdy/spdy_http_stream.cc
+++ b/net/spdy/spdy_http_stream.cc
@@ -453,14 +453,28 @@ void SpdyHttpStream::ReadAndSendRequestBodyData() {
base::Bind(&SpdyHttpStream::OnRequestBodyReadCompleted,
weak_factory_.GetWeakPtr()));
- if (rv != ERR_IO_PENDING) {
- // ERR_IO_PENDING is the only possible error.
- CHECK_GE(rv, 0);
+ if (rv != ERR_IO_PENDING)
OnRequestBodyReadCompleted(rv);
- }
+}
+
+void SpdyHttpStream::ResetStreamInternal() {
+ spdy_session_->ResetStream(stream()->stream_id(), RST_STREAM_INTERNAL_ERROR,
+ std::string());
}
void SpdyHttpStream::OnRequestBodyReadCompleted(int status) {
+ if (status < 0) {
+ DCHECK_NE(ERR_IO_PENDING, status);
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE, base::Bind(&SpdyHttpStream::ResetStreamInternal,
+ weak_factory_.GetWeakPtr()));
+
+ // Call the |request_callback| with received error.
+ if (!request_callback_.is_null())
+ DoRequestCallback(status);
+ return;
+ }
+
CHECK_GE(status, 0);
request_body_buf_size_ = status;
const bool eof = request_info_->upload_data_stream->IsEOF();
« no previous file with comments | « net/spdy/spdy_http_stream.h ('k') | net/spdy/spdy_http_stream_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698