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

Unified Diff: net/quic/quic_http_stream.cc

Issue 1626703002: QUIC - fix crash when writing part of the request body fails (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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/quic/quic_http_stream_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_http_stream.cc
diff --git a/net/quic/quic_http_stream.cc b/net/quic/quic_http_stream.cc
index 20d1e365e761de486c627d40cc51baafcd9c4bf0..81b57f8f42827b4514489906ba18b2aaa26844f6 100644
--- a/net/quic/quic_http_stream.cc
+++ b/net/quic/quic_http_stream.cc
@@ -471,6 +471,10 @@ int QuicHttpStream::DoReadRequestBodyComplete(int rv) {
if (rv < 0)
return rv;
+ // If the stream is already closed, don't continue.
+ if (!stream_)
+ return response_status_;
+
request_body_buf_ = new DrainableIOBuffer(raw_request_body_buf_.get(), rv);
if (rv == 0) { // Reached the end.
DCHECK(request_body_stream_->IsEOF());
@@ -504,6 +508,10 @@ int QuicHttpStream::DoSendBodyComplete(int rv) {
if (rv < 0)
return rv;
+ // If the stream is already closed, don't continue.
+ if (!stream_)
+ return response_status_;
+
request_body_buf_->DidConsume(request_body_buf_->BytesRemaining());
if (!request_body_stream_->IsEOF()) {
« no previous file with comments | « no previous file | net/quic/quic_http_stream_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698