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

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

Issue 9705046: Switch CreateSpdyHeadersFromHttpRequest to construct the correct headers based on the spdy protocol… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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 | Annotate | Revision Log
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/spdy/spdy_proxy_client_socket.h" 5 #include "net/spdy/spdy_proxy_client_socket.h"
6 6
7 #include <algorithm> // min 7 #include <algorithm> // min
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 if (net_log_.IsLoggingAllEvents()) { 365 if (net_log_.IsLoggingAllEvents()) {
366 net_log_.AddEvent( 366 net_log_.AddEvent(
367 NetLog::TYPE_HTTP_TRANSACTION_SEND_TUNNEL_HEADERS, 367 NetLog::TYPE_HTTP_TRANSACTION_SEND_TUNNEL_HEADERS,
368 make_scoped_refptr(new NetLogHttpRequestParameter( 368 make_scoped_refptr(new NetLogHttpRequestParameter(
369 request_line, request_headers))); 369 request_line, request_headers)));
370 } 370 }
371 371
372 request_.extra_headers.MergeFrom(request_headers); 372 request_.extra_headers.MergeFrom(request_headers);
373 linked_ptr<spdy::SpdyHeaderBlock> headers(new spdy::SpdyHeaderBlock()); 373 linked_ptr<spdy::SpdyHeaderBlock> headers(new spdy::SpdyHeaderBlock());
374 CreateSpdyHeadersFromHttpRequest(request_, request_headers, headers.get(), 374 CreateSpdyHeadersFromHttpRequest(request_, request_headers, headers.get(),
375 true); 375 spdy_stream_->GetProtocolVersion(), true);
376 // Reset the URL to be the endpoint of the connection 376 // Reset the URL to be the endpoint of the connection
377 (*headers)["url"] = endpoint_.ToString(); 377 if (spdy_stream_->GetProtocolVersion() > 2) {
ramant (doing other things) 2012/03/15 05:41:34 nit: Please move comment left by 2 spaces. (duplic
Ryan Hamilton 2012/03/15 16:38:06 Done.
378 headers->erase("scheme"); 378 (*headers)[":path"] = endpoint_.ToString();
379 headers->erase(":scheme");
380 } else {
381 // Reset the URL to be the endpoint of the connection
382 (*headers)["url"] = endpoint_.ToString();
383 headers->erase("scheme");
384 }
379 spdy_stream_->set_spdy_headers(headers); 385 spdy_stream_->set_spdy_headers(headers);
380 386
381 return spdy_stream_->SendRequest(true); 387 return spdy_stream_->SendRequest(true);
382 } 388 }
383 389
384 int SpdyProxyClientSocket::DoSendRequestComplete(int result) { 390 int SpdyProxyClientSocket::DoSendRequestComplete(int result) {
385 if (result < 0) 391 if (result < 0)
386 return result; 392 return result;
387 393
388 // Wait for SYN_REPLY frame from the server 394 // Wait for SYN_REPLY frame from the server
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 } 545 }
540 // This may have been deleted by read_callback_, so check first. 546 // This may have been deleted by read_callback_, so check first.
541 if (weak_ptr && !write_callback.is_null()) 547 if (weak_ptr && !write_callback.is_null())
542 write_callback.Run(ERR_CONNECTION_CLOSED); 548 write_callback.Run(ERR_CONNECTION_CLOSED);
543 } 549 }
544 550
545 void SpdyProxyClientSocket::set_chunk_callback(ChunkCallback* /*callback*/) { 551 void SpdyProxyClientSocket::set_chunk_callback(ChunkCallback* /*callback*/) {
546 } 552 }
547 553
548 } // namespace net 554 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698