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

Unified Diff: net/quic/chromium/quic_http_stream.cc

Issue 2298823002: Resetting the HttpRequestInfo pointers in HttpNetworkTransaction and streams (Closed)
Patch Set: Rebased till refs/heads/master@{#425377} Created 4 years, 2 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/quic/chromium/quic_http_stream.h ('k') | net/spdy/spdy_http_stream.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/chromium/quic_http_stream.cc
diff --git a/net/quic/chromium/quic_http_stream.cc b/net/quic/chromium/quic_http_stream.cc
index 059f7dd5632ec1d5835b91fac27879129a003b12..d57b361455378c6909b21f7288737cad8294768a 100644
--- a/net/quic/chromium/quic_http_stream.cc
+++ b/net/quic/chromium/quic_http_stream.cc
@@ -306,6 +306,14 @@ int QuicHttpStream::ReadResponseBody(IOBuffer* buf,
CHECK(!user_buffer_.get());
CHECK_EQ(0, user_buffer_len_);
+ // Invalidate HttpRequestInfo pointer. This is to allow the stream to be
+ // shared across multiple transactions which might require this
+ // stream to outlive the request_info_'s owner.
+ // Only allowed when Read state machine starts. It is safe to reset it at
+ // this point since request_info_->upload_data_stream is also not needed
+ // anymore.
+ request_info_ = nullptr;
+
if (!stream_) {
// If the stream is already closed, there is no body to read.
return response_status_;
@@ -694,7 +702,7 @@ int QuicHttpStream::DoSendHeadersComplete(int rv) {
if (rv < 0)
return rv;
- // If the stream is already closed, don't read the request the body.
+ // If the stream is already closed, don't read the request body.
if (!stream_)
return response_status_;
« no previous file with comments | « net/quic/chromium/quic_http_stream.h ('k') | net/spdy/spdy_http_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698