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

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

Issue 1257623004: Send appropriate pseudo-headers in HTTP/2 CONNECT request. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « net/spdy/spdy_proxy_client_socket_unittest.cc ('k') | no next file » | 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/spdy_test_util_common.h" 5 #include "net/spdy/spdy_test_util_common.h"
6 6
7 #include <cstddef> 7 #include <cstddef>
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 958 matching lines...) Expand 10 before | Expand all | Expand 10 after
969 } 969 }
970 970
971 SpdyFrame* SpdyTestUtil::ConstructSpdyConnect( 971 SpdyFrame* SpdyTestUtil::ConstructSpdyConnect(
972 const char* const extra_headers[], 972 const char* const extra_headers[],
973 int extra_header_count, 973 int extra_header_count,
974 int stream_id, 974 int stream_id,
975 RequestPriority priority, 975 RequestPriority priority,
976 const HostPortPair& host_port_pair) const { 976 const HostPortPair& host_port_pair) const {
977 SpdyHeaderBlock block; 977 SpdyHeaderBlock block;
978 block[GetMethodKey()] = "CONNECT"; 978 block[GetMethodKey()] = "CONNECT";
979 block[GetPathKey()] = host_port_pair.ToString(); 979 if (spdy_version() < HTTP2) {
980 block[GetHostKey()] = (host_port_pair.port() == 443) 980 block[GetPathKey()] = host_port_pair.ToString();
981 ? host_port_pair.host() 981 block[GetHostKey()] = (host_port_pair.port() == 443)
982 : host_port_pair.ToString(); 982 ? host_port_pair.host()
983 : host_port_pair.ToString();
984 } else {
985 block[GetHostKey()] = host_port_pair.ToString();
986 }
987
983 MaybeAddVersionHeader(&block); 988 MaybeAddVersionHeader(&block);
984 AppendToHeaderBlock(extra_headers, extra_header_count, &block); 989 AppendToHeaderBlock(extra_headers, extra_header_count, &block);
985 return ConstructSpdySyn(stream_id, block, priority, false, false); 990 return ConstructSpdySyn(stream_id, block, priority, false, false);
986 } 991 }
987 992
988 SpdyFrame* SpdyTestUtil::ConstructSpdyPush(const char* const extra_headers[], 993 SpdyFrame* SpdyTestUtil::ConstructSpdyPush(const char* const extra_headers[],
989 int extra_header_count, 994 int extra_header_count,
990 int stream_id, 995 int stream_id,
991 int associated_stream_id, 996 int associated_stream_id,
992 const char* url) { 997 const char* url) {
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
1328 } 1333 }
1329 } 1334 }
1330 1335
1331 void SpdyTestUtil::SetPriority(RequestPriority priority, 1336 void SpdyTestUtil::SetPriority(RequestPriority priority,
1332 SpdySynStreamIR* ir) const { 1337 SpdySynStreamIR* ir) const {
1333 ir->set_priority(ConvertRequestPriorityToSpdyPriority( 1338 ir->set_priority(ConvertRequestPriorityToSpdyPriority(
1334 priority, spdy_version())); 1339 priority, spdy_version()));
1335 } 1340 }
1336 1341
1337 } // namespace net 1342 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/spdy_proxy_client_socket_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698