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

Unified Diff: net/spdy/spdy_http_stream.cc

Issue 3020032: Implement server push protocol 2. (Closed)
Patch Set: nits. Created 10 years, 4 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/http/http_network_layer.cc ('k') | net/spdy/spdy_network_transaction_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 bb64021f98fd56d61ba2dd61e9f973b733fd4cd7..4e62b4588f17ba3981db797a383c895a4cc35d76 100644
--- a/net/spdy/spdy_http_stream.cc
+++ b/net/spdy/spdy_http_stream.cc
@@ -262,6 +262,7 @@ int SpdyHttpStream::SendRequest(const std::string& /*headers_string*/,
CHECK(stream_.get());
stream_->SetDelegate(this);
+
linked_ptr<spdy::SpdyHeaderBlock> headers(new spdy::SpdyHeaderBlock);
CreateSpdyHeadersFromHttpRequest(*request_info_, headers.get());
stream_->set_spdy_headers(headers);
@@ -285,7 +286,7 @@ int SpdyHttpStream::SendRequest(const std::string& /*headers_string*/,
CHECK(!stream_->cancelled());
CHECK(response);
- if (stream_->response_complete()) {
+ if (!stream_->pushed() && stream_->response_complete()) {
if (stream_->response_status() == OK)
return ERR_FAILED;
else
@@ -297,16 +298,14 @@ int SpdyHttpStream::SendRequest(const std::string& /*headers_string*/,
// a) A client initiated request. In this case, |response_info_| should be
// NULL to start with.
// b) A client request which matches a response that the server has already
- // pushed. In this case, the value of |*push_response_info_| is copied
- // over to the new response object |*response|. |push_response_info_| is
- // deleted, and |response_info_| is reset |response|.
+ // pushed.
if (push_response_info_.get()) {
- *response = *push_response_info_;
+ *response = *(push_response_info_.get());
push_response_info_.reset();
- response_info_ = NULL;
}
+ else
+ DCHECK_EQ(static_cast<HttpResponseInfo*>(NULL), response_info_);
- DCHECK_EQ(static_cast<HttpResponseInfo*>(NULL), response_info_);
response_info_ = response;
bool has_upload_data = request_body_stream_.get() != NULL;
« no previous file with comments | « net/http/http_network_layer.cc ('k') | net/spdy/spdy_network_transaction_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698