summaryrefslogtreecommitdiffstats
path: root/net/http/http_proxy_client_socket.cc
diff options
context:
space:
mode:
authorrch@chromium.org <rch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-01 20:55:17 +0000
committerrch@chromium.org <rch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-01 20:55:17 +0000
commit7642b5aed675a2b99007a833d58b705b493b5ef4 (patch)
treeee9b7ce6cb84cc495eb26ac5ece10b89a7ff038a /net/http/http_proxy_client_socket.cc
parentf30394e222a0df68576c8564ecb4e1a8b4bf0d20 (diff)
downloadchromium_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/http/http_proxy_client_socket.cc')
-rw-r--r--net/http/http_proxy_client_socket.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/net/http/http_proxy_client_socket.cc b/net/http/http_proxy_client_socket.cc
index 7ed80a5..eccd652 100644
--- a/net/http/http_proxy_client_socket.cc
+++ b/net/http/http_proxy_client_socket.cc
@@ -53,7 +53,8 @@ HttpProxyClientSocket::HttpProxyClientSocket(
ClientSocketHandle* transport_socket, const GURL& request_url,
const std::string& user_agent, const HostPortPair& endpoint,
const HostPortPair& proxy_server,
- const scoped_refptr<HttpNetworkSession>& session, bool tunnel)
+ const scoped_refptr<HttpNetworkSession>& session, bool tunnel,
+ bool using_spdy)
: ALLOW_THIS_IN_INITIALIZER_LIST(
io_callback_(this, &HttpProxyClientSocket::OnIOComplete)),
next_state_(STATE_NONE),
@@ -65,6 +66,7 @@ HttpProxyClientSocket::HttpProxyClientSocket(
GURL("http://" + proxy_server.ToString()),
session) : NULL),
tunnel_(tunnel),
+ using_spdy_(using_spdy),
net_log_(transport_socket->socket()->NetLog()) {
// Synthesize the bits of a request that we actually use.
request_.url = request_url;
@@ -83,7 +85,12 @@ int HttpProxyClientSocket::Connect(CompletionCallback* callback) {
DCHECK(transport_->socket());
DCHECK(!user_callback_);
- if (!tunnel_)
+ // TODO(rch): figure out the right way to set up a tunnel with SPDY.
+ // This approach sends the complete HTTPS request to the proxy
+ // which allows the proxy to see "private" data. Instead, we should
+ // create an SSL tunnel to the origin server using the CONNECT method
+ // inside a single SPDY stream.
+ if (using_spdy_ || !tunnel_)
next_state_ = STATE_DONE;
if (next_state_ == STATE_DONE)
return OK;