diff options
author | rch@chromium.org <rch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-01 20:55:17 +0000 |
---|---|---|
committer | rch@chromium.org <rch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-01 20:55:17 +0000 |
commit | 7642b5aed675a2b99007a833d58b705b493b5ef4 (patch) | |
tree | ee9b7ce6cb84cc495eb26ac5ece10b89a7ff038a /net/spdy/spdy_http_stream.cc | |
parent | f30394e222a0df68576c8564ecb4e1a8b4bf0d20 (diff) | |
download | chromium_src-7642b5aed675a2b99007a833d58b705b493b5ef4.zip chromium_src-7642b5aed675a2b99007a833d58b705b493b5ef4.tar.gz chromium_src-7642b5aed675a2b99007a833d58b705b493b5ef4.tar.bz2 |
Add support for speaking SPDY to an HTTPS proxy.
Currently only http urls are supported.
BUG=29625
TEST=HttpNetworkTransactionTest.HttpsProxySpdyGet
Review URL: http://codereview.chromium.org/3259006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58236 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/spdy/spdy_http_stream.cc')
-rw-r--r-- | net/spdy/spdy_http_stream.cc | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/net/spdy/spdy_http_stream.cc b/net/spdy/spdy_http_stream.cc index 8072d53..2880b07 100644 --- a/net/spdy/spdy_http_stream.cc +++ b/net/spdy/spdy_http_stream.cc @@ -91,7 +91,8 @@ bool SpdyHeadersToHttpResponse(const spdy::SpdyHeaderBlock& headers, // Create a SpdyHeaderBlock for a Spdy SYN_STREAM Frame from // a HttpRequestInfo block. void CreateSpdyHeadersFromHttpRequest( - const net::HttpRequestInfo& info, spdy::SpdyHeaderBlock* headers) { + const net::HttpRequestInfo& info, spdy::SpdyHeaderBlock* headers, + bool direct) { // TODO(willchan): It's not really necessary to convert from // HttpRequestHeaders to spdy::SpdyHeaderBlock. @@ -131,7 +132,10 @@ void CreateSpdyHeadersFromHttpRequest( (*headers)["content-length"] = "0"; } - (*headers)["url"] = net::HttpUtil::PathForRequest(info.url); + if (direct) + (*headers)["url"] = net::HttpUtil::PathForRequest(info.url); + else + (*headers)["url"] = net::HttpUtil::SpecForRequest(info.url); (*headers)["host"] = net::GetHostAndOptionalPort(info.url); (*headers)["scheme"] = info.url.scheme(); (*headers)["version"] = kHttpProtocolVersion; @@ -151,7 +155,7 @@ void CreateSpdyHeadersFromHttpRequest( namespace net { -SpdyHttpStream::SpdyHttpStream(SpdySession* spdy_session) +SpdyHttpStream::SpdyHttpStream(SpdySession* spdy_session, bool direct) : ALLOW_THIS_IN_INITIALIZER_LIST(read_callback_factory_(this)), stream_(NULL), spdy_session_(spdy_session), @@ -160,7 +164,8 @@ SpdyHttpStream::SpdyHttpStream(SpdySession* spdy_session) user_callback_(NULL), user_buffer_len_(0), buffered_read_callback_pending_(false), - more_read_data_pending_(false) { } + more_read_data_pending_(false), + direct_(direct) { } SpdyHttpStream::~SpdyHttpStream() { if (stream_) @@ -279,7 +284,7 @@ int SpdyHttpStream::SendRequest(const std::string& /*headers_string*/, stream_->SetDelegate(this); linked_ptr<spdy::SpdyHeaderBlock> headers(new spdy::SpdyHeaderBlock); - CreateSpdyHeadersFromHttpRequest(*request_info_, headers.get()); + CreateSpdyHeadersFromHttpRequest(*request_info_, headers.get(), direct_); stream_->set_spdy_headers(headers); stream_->SetRequestTime(request_time); |