summaryrefslogtreecommitdiffstats
path: root/net/http
diff options
context:
space:
mode:
authorericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-08 22:11:39 +0000
committerericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-08 22:11:39 +0000
commit6d748ec125d222f1d45c913d30a8e8317d10eb43 (patch)
tree0b4789f4e43958f1f98bee3a4517583ceeba8380 /net/http
parentf8d434bd5be573b2954faa2ff4bfef37db6d194e (diff)
downloadchromium_src-6d748ec125d222f1d45c913d30a8e8317d10eb43.zip
chromium_src-6d748ec125d222f1d45c913d30a8e8317d10eb43.tar.gz
chromium_src-6d748ec125d222f1d45c913d30a8e8317d10eb43.tar.bz2
Unrollback 3024 (partially rolled back in 3027).
It is fixed in mac build now -- problem was bad format string to StringPrintf, where passed string instead of char*. Review URL: http://codereview.chromium.org/6359 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3064 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http')
-rw-r--r--net/http/http_auth_handler_digest.cc2
-rw-r--r--net/http/http_network_transaction.cc20
2 files changed, 7 insertions, 15 deletions
diff --git a/net/http/http_auth_handler_digest.cc b/net/http/http_auth_handler_digest.cc
index 7f351b4..18f166b 100644
--- a/net/http/http_auth_handler_digest.cc
+++ b/net/http/http_auth_handler_digest.cc
@@ -117,7 +117,7 @@ void HttpAuthHandlerDigest::GetRequestMethodAndPath(
if (target_ == HttpAuth::AUTH_PROXY && url.SchemeIs("https")) {
*method = "CONNECT";
- *path = url.host() + ":" + GetImplicitPort(url);
+ *path = url.host() + ":" + IntToString(url.EffectiveIntPort());
} else {
*method = request->method;
*path = HttpUtil::PathForRequest(url);
diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc
index de3539317..cdb9966 100644
--- a/net/http/http_network_transaction.cc
+++ b/net/http/http_network_transaction.cc
@@ -247,13 +247,12 @@ void HttpNetworkTransaction::BuildRequestHeaders() {
// in draft-luotonen-web-proxy-tunneling-01.txt and RFC 2817, Sections 5.2 and
// 5.3.
void HttpNetworkTransaction::BuildTunnelRequest() {
- std::string port = GetImplicitPort(request_->url);
-
// RFC 2616 Section 9 says the Host request-header field MUST accompany all
// HTTP/1.1 requests.
- request_headers_ = "CONNECT " + request_->url.host() + ":" + port +
- " HTTP/1.1\r\nHost: " + request_->url.host();
- if (request_->url.IntPort() != -1)
+ request_headers_ = StringPrintf("CONNECT %s:%d HTTP/1.1\r\n",
+ request_->url.host().c_str(), request_->url.EffectiveIntPort());
+ request_headers_ += "Host: " + request_->url.host();
+ if (request_->url.has_port())
request_headers_ += ":" + request_->url.port();
request_headers_ += "\r\n";
@@ -453,18 +452,11 @@ int HttpNetworkTransaction::DoResolveHost() {
t.GetNext();
host = t.token();
t.GetNext();
- port = static_cast<int>(StringToInt64(t.token()));
+ port = StringToInt(t.token());
} else {
// Direct connection
host = request_->url.host();
- port = request_->url.IntPort();
- if (port == url_parse::PORT_UNSPECIFIED) {
- if (using_ssl_) {
- port = 443; // Default HTTPS port
- } else {
- port = 80; // Default HTTP port
- }
- }
+ port = request_->url.EffectiveIntPort();
}
return resolver_.Resolve(host, port, &addresses_, &io_callback_);