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

Side by Side Diff: net/tools/quic/quic_spdy_client_stream.cc

Issue 2104633002: Landing recent QUIC changes until 6/24/2016 14:00 UTC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/tools/quic/quic_spdy_client_stream.h" 5 #include "net/tools/quic/quic_spdy_client_stream.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 DCHECK(headers_decompressed()); 50 DCHECK(headers_decompressed());
51 header_bytes_read_ += frame_len; 51 header_bytes_read_ += frame_len;
52 if (!SpdyUtils::ParseHeaders(decompressed_headers().data(), 52 if (!SpdyUtils::ParseHeaders(decompressed_headers().data(),
53 decompressed_headers().length(), 53 decompressed_headers().length(),
54 &content_length_, &response_headers_)) { 54 &content_length_, &response_headers_)) {
55 DLOG(ERROR) << "Failed to parse headers: " << decompressed_headers(); 55 DLOG(ERROR) << "Failed to parse headers: " << decompressed_headers();
56 Reset(QUIC_BAD_APPLICATION_PAYLOAD); 56 Reset(QUIC_BAD_APPLICATION_PAYLOAD);
57 return; 57 return;
58 } 58 }
59 59
60 if (!ParseHeaderStatusCode(&response_headers_, &response_code_)) { 60 if (!ParseHeaderStatusCode(response_headers_, &response_code_)) {
61 DLOG(ERROR) << "Received invalid response code: " 61 DLOG(ERROR) << "Received invalid response code: "
62 << response_headers_[":status"].as_string(); 62 << response_headers_[":status"].as_string();
63 Reset(QUIC_BAD_APPLICATION_PAYLOAD); 63 Reset(QUIC_BAD_APPLICATION_PAYLOAD);
64 return; 64 return;
65 } 65 }
66 66
67 MarkHeadersConsumed(decompressed_headers().length()); 67 MarkHeadersConsumed(decompressed_headers().length());
68 DVLOG(1) << "headers complete for stream " << id(); 68 DVLOG(1) << "headers complete for stream " << id();
69 69
70 session_->OnInitialHeadersComplete(id(), response_headers_); 70 session_->OnInitialHeadersComplete(id(), response_headers_);
71 } 71 }
72 72
73 void QuicSpdyClientStream::OnInitialHeadersComplete( 73 void QuicSpdyClientStream::OnInitialHeadersComplete(
74 bool fin, 74 bool fin,
75 size_t frame_len, 75 size_t frame_len,
76 const QuicHeaderList& header_list) { 76 const QuicHeaderList& header_list) {
77 QuicSpdyStream::OnInitialHeadersComplete(fin, frame_len, header_list); 77 QuicSpdyStream::OnInitialHeadersComplete(fin, frame_len, header_list);
78 78
79 DCHECK(headers_decompressed()); 79 DCHECK(headers_decompressed());
80 header_bytes_read_ += frame_len; 80 header_bytes_read_ += frame_len;
81 if (!SpdyUtils::CopyAndValidateHeaders(header_list, &content_length_, 81 if (!SpdyUtils::CopyAndValidateHeaders(header_list, &content_length_,
82 &response_headers_)) { 82 &response_headers_)) {
83 DLOG(ERROR) << "Failed to parse header list: " << header_list.DebugString(); 83 DLOG(ERROR) << "Failed to parse header list: " << header_list.DebugString();
84 Reset(QUIC_BAD_APPLICATION_PAYLOAD); 84 Reset(QUIC_BAD_APPLICATION_PAYLOAD);
85 return; 85 return;
86 } 86 }
87 87
88 if (!ParseHeaderStatusCode(&response_headers_, &response_code_)) { 88 if (!ParseHeaderStatusCode(response_headers_, &response_code_)) {
89 DLOG(ERROR) << "Received invalid response code: " 89 DLOG(ERROR) << "Received invalid response code: "
90 << response_headers_[":status"].as_string(); 90 << response_headers_[":status"].as_string();
91 Reset(QUIC_BAD_APPLICATION_PAYLOAD); 91 Reset(QUIC_BAD_APPLICATION_PAYLOAD);
92 return; 92 return;
93 } 93 }
94 94
95 ConsumeHeaderList(); 95 ConsumeHeaderList();
96 DVLOG(1) << "headers complete for stream " << id(); 96 DVLOG(1) << "headers complete for stream " << id();
97 97
98 session_->OnInitialHeadersComplete(id(), response_headers_); 98 session_->OnInitialHeadersComplete(id(), response_headers_);
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 bytes_sent += header_bytes_written_; 192 bytes_sent += header_bytes_written_;
193 193
194 if (!body.empty()) { 194 if (!body.empty()) {
195 WriteOrBufferData(body, fin, nullptr); 195 WriteOrBufferData(body, fin, nullptr);
196 } 196 }
197 197
198 return bytes_sent; 198 return bytes_sent;
199 } 199 }
200 200
201 } // namespace net 201 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/quic/quic_simple_server_stream.cc ('k') | net/tools/quic/test_tools/quic_test_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698