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

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

Issue 1961573002: Avoids the "re-encode HPACK as SPDY3" step. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update new test Created 4 years, 7 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/header_coalescer.h ('k') | net/spdy/mock_spdy_framer_visitor.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "net/spdy/header_coalescer.h"
6
7 #include "base/strings/string_util.h"
8
9 namespace net {
10
11 void HeaderCoalescer::OnHeader(base::StringPiece key, base::StringPiece value) {
12 if (key.empty()) {
13 DVLOG(1) << "Header name must not be empty.";
14 error_seen_ = true;
15 return;
16 }
17
18 auto iter = headers_.find(key);
19 if (iter == headers_.end()) {
20 headers_[key] = value;
21 } else {
22 // This header had multiple values, so it must be reconstructed.
23 base::StringPiece v = iter->second;
24 std::string s(v.data(), v.length());
25 if (key == "cookie") {
26 // Obeys section 8.1.2.5 in RFC 7540 for cookie reconstruction.
27 s.append("; ");
28 } else {
29 base::StringPiece("\0", 1).AppendToString(&s);
30 }
31 value.AppendToString(&s);
32 headers_.ReplaceOrAppendHeader(key, s);
33 }
34 }
35
36 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/header_coalescer.h ('k') | net/spdy/mock_spdy_framer_visitor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698