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

Side by Side Diff: net/spdy/chromium/header_coalescer.cc

Issue 2974613002: Allow large response headers to buffer in HpackDecoder. (Closed)
Patch Set: naught but a nit Created 3 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
« no previous file with comments | « net/spdy/chromium/header_coalescer.h ('k') | net/spdy/chromium/spdy_session.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2016 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/spdy/chromium/header_coalescer.h" 5 #include "net/spdy/chromium/header_coalescer.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 13 matching lines...) Expand all
24 auto dict = base::MakeUnique<base::DictionaryValue>(); 24 auto dict = base::MakeUnique<base::DictionaryValue>();
25 dict->SetString("header_name", header_name); 25 dict->SetString("header_name", header_name);
26 dict->SetString("header_value", ElideHeaderValueForNetLog( 26 dict->SetString("header_value", ElideHeaderValueForNetLog(
27 capture_mode, header_name.as_string(), 27 capture_mode, header_name.as_string(),
28 header_value.as_string())); 28 header_value.as_string()));
29 return std::move(dict); 29 return std::move(dict);
30 } 30 }
31 31
32 } // namespace 32 } // namespace
33 33
34 const size_t kMaxHeaderListSize = 256 * 1024;
35
36 HeaderCoalescer::HeaderCoalescer(const NetLogWithSource& net_log) 34 HeaderCoalescer::HeaderCoalescer(const NetLogWithSource& net_log)
37 : net_log_(net_log) {} 35 : net_log_(net_log) {}
38 36
39 void HeaderCoalescer::OnHeader(SpdyStringPiece key, SpdyStringPiece value) { 37 void HeaderCoalescer::OnHeader(SpdyStringPiece key, SpdyStringPiece value) {
40 if (error_seen_) 38 if (error_seen_)
41 return; 39 return;
42 if (!AddHeader(key, value)) { 40 if (!AddHeader(key, value)) {
43 error_seen_ = true; 41 error_seen_ = true;
44 if (net_log_.IsCapturing()) { 42 if (net_log_.IsCapturing()) {
45 net_log_.AddEvent(NetLogEventType::HTTP2_SESSION_RECV_INVALID_HEADER, 43 net_log_.AddEvent(NetLogEventType::HTTP2_SESSION_RECV_INVALID_HEADER,
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 SpdyStringPiece("\0", 1).AppendToString(&s); 100 SpdyStringPiece("\0", 1).AppendToString(&s);
103 } 101 }
104 value.AppendToString(&s); 102 value.AppendToString(&s);
105 headers_[key] = s; 103 headers_[key] = s;
106 } 104 }
107 return true; 105 return true;
108 } 106 }
109 107
110 108
111 } // namespace net 109 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/chromium/header_coalescer.h ('k') | net/spdy/chromium/spdy_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698