summaryrefslogtreecommitdiffstats
path: root/net/http
diff options
context:
space:
mode:
authorrch@chromium.org <rch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-28 04:58:38 +0000
committerrch@chromium.org <rch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-28 04:58:38 +0000
commit1c703210a2dbf7d5ff0ba06029e0411f0728c4e1 (patch)
treec6584610de9c306b6345f2395fdcd00bbf250c48 /net/http
parent06fb18592e5fad681cf33d80bae8a51862d8a923 (diff)
downloadchromium_src-1c703210a2dbf7d5ff0ba06029e0411f0728c4e1.zip
chromium_src-1c703210a2dbf7d5ff0ba06029e0411f0728c4e1.tar.gz
chromium_src-1c703210a2dbf7d5ff0ba06029e0411f0728c4e1.tar.bz2
Revert 60747 - Add a new class SpdyProxyClientSocket which implements ClientSocket
by sending a CONNECT request via a SPDY SYN_STREAM frame to a SPDY proxy, and then reading/writing data to/from SPDY Data frames. BUG=29625 TEST=none Review URL: http://codereview.chromium.org/3432009 TBR=rch@chromium.org Review URL: http://codereview.chromium.org/3391029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60754 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http')
-rw-r--r--net/http/http_proxy_client_socket.cc33
-rw-r--r--net/http/http_proxy_utils.cc39
-rw-r--r--net/http/http_proxy_utils.h28
3 files changed, 31 insertions, 69 deletions
diff --git a/net/http/http_proxy_client_socket.cc b/net/http/http_proxy_client_socket.cc
index ddefe8e..ccc5d5d 100644
--- a/net/http/http_proxy_client_socket.cc
+++ b/net/http/http_proxy_client_socket.cc
@@ -14,13 +14,42 @@
#include "net/base/net_util.h"
#include "net/http/http_net_log_params.h"
#include "net/http/http_network_session.h"
-#include "net/http/http_proxy_utils.h"
#include "net/http/http_request_info.h"
#include "net/http/http_stream_parser.h"
#include "net/socket/client_socket_handle.h"
namespace net {
+namespace {
+
+// The HTTP CONNECT method for establishing a tunnel connection is documented
+// in draft-luotonen-web-proxy-tunneling-01.txt and RFC 2817, Sections 5.2 and
+// 5.3.
+void BuildTunnelRequest(const HttpRequestInfo* request_info,
+ const HttpRequestHeaders& authorization_headers,
+ const HostPortPair& endpoint,
+ std::string* request_line,
+ HttpRequestHeaders* request_headers) {
+ // RFC 2616 Section 9 says the Host request-header field MUST accompany all
+ // HTTP/1.1 requests. Add "Proxy-Connection: keep-alive" for compat with
+ // HTTP/1.0 proxies such as Squid (required for NTLM authentication).
+ *request_line = base::StringPrintf(
+ "CONNECT %s HTTP/1.1\r\n", endpoint.ToString().c_str());
+ request_headers->SetHeader(HttpRequestHeaders::kHost,
+ GetHostAndOptionalPort(request_info->url));
+ request_headers->SetHeader(HttpRequestHeaders::kProxyConnection,
+ "keep-alive");
+
+ std::string user_agent;
+ if (request_info->extra_headers.GetHeader(HttpRequestHeaders::kUserAgent,
+ &user_agent))
+ request_headers->SetHeader(HttpRequestHeaders::kUserAgent, user_agent);
+
+ request_headers->MergeFrom(authorization_headers);
+}
+
+} // namespace
+
HttpProxyClientSocket::HttpProxyClientSocket(
ClientSocketHandle* transport_socket,
const GURL& request_url,
@@ -329,7 +358,7 @@ int HttpProxyClientSocket::DoSendRequest() {
auth_->AddAuthorizationHeader(&authorization_headers);
std::string request_line;
HttpRequestHeaders request_headers;
- BuildTunnelRequest(request_, authorization_headers, endpoint_,
+ BuildTunnelRequest(&request_, authorization_headers, endpoint_,
&request_line, &request_headers);
if (net_log_.IsLoggingAll()) {
net_log_.AddEvent(
diff --git a/net/http/http_proxy_utils.cc b/net/http/http_proxy_utils.cc
deleted file mode 100644
index 3e4fb8b..0000000
--- a/net/http/http_proxy_utils.cc
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "net/http/http_proxy_utils.h"
-
-#include "base/string_util.h"
-#include "googleurl/src/gurl.h"
-#include "net/base/host_port_pair.h"
-#include "net/base/net_util.h"
-#include "net/http/http_request_info.h"
-
-namespace net {
-
-void BuildTunnelRequest(
- const HttpRequestInfo& request_info,
- const HttpRequestHeaders& auth_headers,
- const HostPortPair& endpoint,
- std::string* request_line,
- HttpRequestHeaders* request_headers) {
- // RFC 2616 Section 9 says the Host request-header field MUST accompany all
- // HTTP/1.1 requests. Add "Proxy-Connection: keep-alive" for compat with
- // HTTP/1.0 proxies such as Squid (required for NTLM authentication).
- *request_line = StringPrintf(
- "CONNECT %s HTTP/1.1\r\n", endpoint.ToString().c_str());
- request_headers->SetHeader(HttpRequestHeaders::kHost,
- GetHostAndOptionalPort(request_info.url));
- request_headers->SetHeader(HttpRequestHeaders::kProxyConnection,
- "keep-alive");
-
- std::string user_agent;
- if (request_info.extra_headers.GetHeader(HttpRequestHeaders::kUserAgent,
- &user_agent))
- request_headers->SetHeader(HttpRequestHeaders::kUserAgent, user_agent);
-
- request_headers->MergeFrom(auth_headers);
-}
-
-} // namespace net
diff --git a/net/http/http_proxy_utils.h b/net/http/http_proxy_utils.h
deleted file mode 100644
index 9d18fc8..0000000
--- a/net/http/http_proxy_utils.h
+++ /dev/null
@@ -1,28 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef NET_HTTP_HTTP_PROXY_UTILS_H_
-#define NET_HTTP_HTTP_PROXY_UTILS_H_
-#pragma once
-
-#include <string>
-
-namespace net {
-
-struct HttpRequestInfo;
-class HttpRequestHeaders;
-class HostPortPair;
-
-// The HTTP CONNECT method for establishing a tunnel connection is documented
-// in draft-luotonen-web-proxy-tunneling-01.txt and RFC 2817, Sections 5.2 and
-// 5.3.
-void BuildTunnelRequest(const HttpRequestInfo& request_info,
- const HttpRequestHeaders& auth_headers,
- const HostPortPair& endpoint,
- std::string* request_line,
- HttpRequestHeaders* request_headers);
-
-} // namespace net
-
-#endif // NET_HTTP_HTTP_PROXY_UTILS_H_