summaryrefslogtreecommitdiffstats
path: root/net/http
diff options
context:
space:
mode:
authorwtc@google.com <wtc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-14 00:00:22 +0000
committerwtc@google.com <wtc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-14 00:00:22 +0000
commit77848d1c600524c50dee24c055b21a210f02e52f (patch)
tree845f71fca700d11b553a4f785be7c7656fb3cf03 /net/http
parente2e66de14a2d076aa0b550677ecb0bcef2998bd1 (diff)
downloadchromium_src-77848d1c600524c50dee24c055b21a210f02e52f.zip
chromium_src-77848d1c600524c50dee24c055b21a210f02e52f.tar.gz
chromium_src-77848d1c600524c50dee24c055b21a210f02e52f.tar.bz2
Add more info to the comment about www.yahoo.com's padding of
the chunk-size field. Fix miscellaneous nits reported by cpplint.py. Use ASCIItoWide instead of UTF8ToWide to convert the username and password specified in a URL. Those two components of the URL have to be ASCII. Carry over a TODO comment about unescaping username/password from http_transaction_winhttp.cc. R=eroman Review URL: http://codereview.chromium.org/10864 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5410 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http')
-rw-r--r--net/http/http_chunked_decoder.cc3
-rw-r--r--net/http/http_network_transaction.cc9
-rw-r--r--net/http/http_network_transaction_unittest.cc9
3 files changed, 13 insertions, 8 deletions
diff --git a/net/http/http_chunked_decoder.cc b/net/http/http_chunked_decoder.cc
index 1ecb9f4..14d1631 100644
--- a/net/http/http_chunked_decoder.cc
+++ b/net/http/http_chunked_decoder.cc
@@ -154,7 +154,8 @@ int HttpChunkedDecoder::ScanForChunkRemaining(const char* buf, int buf_len) {
// While the HTTP 1.1 specification defines chunk-size as 1*HEX
// some sites rely on more lenient parsing.
-// http://www.yahoo.com/ for example, includes trailing spaces (0x20).
+// http://www.yahoo.com/, for example, pads chunk-size with trailing spaces
+// (0x20) to be 7 characters long, such as "819b ".
//
// A comparison of browsers running on WindowsXP shows that
// they will parse the following inputs (egrep syntax):
diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc
index 9783025..6076fab 100644
--- a/net/http/http_network_transaction.cc
+++ b/net/http/http_network_transaction.cc
@@ -472,7 +472,7 @@ int HttpNetworkTransaction::DoResolveHost() {
int HttpNetworkTransaction::DoResolveHostComplete(int result) {
bool ok = (result == OK);
- DidFinishDnsResolutionWithStatus(ok, this->request_->referrer, this);
+ DidFinishDnsResolutionWithStatus(ok, request_->referrer, this);
if (ok) {
next_state_ = STATE_CONNECT;
} else {
@@ -1149,8 +1149,11 @@ bool HttpNetworkTransaction::SelectNextAuthIdentityToTry(
auth_identity_[target].source == HttpAuth::IDENT_SRC_NONE) {
auth_identity_[target].source = HttpAuth::IDENT_SRC_URL;
auth_identity_[target].invalid = false;
- auth_identity_[target].username = UTF8ToWide(request_->url.username());
- auth_identity_[target].password = UTF8ToWide(request_->url.password());
+ // TODO(wtc) It may be necessary to unescape the username and password
+ // after extracting them from the URL. We should be careful about
+ // embedded nulls in that case.
+ auth_identity_[target].username = ASCIIToWide(request_->url.username());
+ auth_identity_[target].password = ASCIIToWide(request_->url.password());
// TODO(eroman): If the password is blank, should we also try combining
// with a password from the cache?
return true;
diff --git a/net/http/http_network_transaction_unittest.cc b/net/http/http_network_transaction_unittest.cc
index 507b90b..fde12f4 100644
--- a/net/http/http_network_transaction_unittest.cc
+++ b/net/http/http_network_transaction_unittest.cc
@@ -2,7 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include <math.h> // ceil
+#include <math.h> // ceil
+
#include "base/compiler_specific.h"
#include "base/platform_test.h"
#include "net/base/client_socket_factory.h"
@@ -899,14 +900,14 @@ TEST_F(HttpNetworkTransactionTest, DontRecycleTCPSocketForSSLTunnel) {
"Host: www.google.com\r\n\r\n"),
};
- // The proxy responds to the connect with a 404, using a persistent
+ // The proxy responds to the connect with a 404, using a persistent
// connection. Usually a proxy would return 501 (not implemented),
// or 200 (tunnel established).
MockRead data_reads1[] = {
MockRead("HTTP/1.1 404 Not Found\r\n"),
MockRead("Content-Length: 10\r\n\r\n"),
MockRead("0123456789"),
- MockRead(false, net::ERR_UNEXPECTED), // Should not be reached.
+ MockRead(false, net::ERR_UNEXPECTED), // Should not be reached.
};
MockSocket data1;
@@ -930,7 +931,7 @@ TEST_F(HttpNetworkTransactionTest, DontRecycleTCPSocketForSSLTunnel) {
EXPECT_EQ(404, response->headers->response_code());
EXPECT_EQ(10, response->headers->GetContentLength());
EXPECT_TRUE(net::HttpVersion(1, 1) == response->headers->GetHttpVersion());
-
+
std::string response_data;
rv = ReadTransaction(trans.get(), &response_data);
EXPECT_STREQ("0123456789", response_data.c_str());