summaryrefslogtreecommitdiffstats
path: root/net/url_request
diff options
context:
space:
mode:
authoreroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-21 23:45:23 +0000
committereroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-21 23:45:23 +0000
commit52574021ab8190a5b93bdf1344dada2b420f4b1c (patch)
tree04d5497d653d5846d71b7dbb5a81ad573e94165e /net/url_request
parent80c845a3a24ed6a60767480b9d7ebe676c018e78 (diff)
downloadchromium_src-52574021ab8190a5b93bdf1344dada2b420f4b1c.zip
chromium_src-52574021ab8190a5b93bdf1344dada2b420f4b1c.tar.gz
chromium_src-52574021ab8190a5b93bdf1344dada2b420f4b1c.tar.bz2
Add some extra request information to LoadLog:
* the error code that URLRequest Start() failed with. * which peer the TCP connection is being made to [Only in full logging mode] (for example, when using a proxy, this may differ from the host:port of the URL). * the type of redirect that was received, and its URL [Only in full logging mode] BUG=NONE TEST=NONE Review URL: http://codereview.chromium.org/553043 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36813 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/url_request')
-rw-r--r--net/url_request/url_request.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/net/url_request/url_request.cc b/net/url_request/url_request.cc
index ec2eace..7a09123 100644
--- a/net/url_request/url_request.cc
+++ b/net/url_request/url_request.cc
@@ -357,6 +357,9 @@ void URLRequest::ReceivedRedirect(const GURL& location, bool* defer_redirect) {
}
void URLRequest::ResponseStarted() {
+ if (!status_.is_success())
+ net::LoadLog::AddErrorCode(load_log_, status_.os_error());
+
net::LoadLog::EndEvent(load_log_, net::LoadLog::TYPE_URL_REQUEST_START);
URLRequestJob* job = GetJobManager()->MaybeInterceptResponse(this);
@@ -430,6 +433,10 @@ std::string URLRequest::StripPostSpecificHeaders(const std::string& headers) {
}
int URLRequest::Redirect(const GURL& location, int http_status_code) {
+ if (net::LoadLog::IsUnbounded(load_log_)) {
+ net::LoadLog::AddString(load_log_, StringPrintf("Redirected (%d) to %s",
+ http_status_code, location.spec().c_str()));
+ }
if (redirect_limit_ <= 0) {
DLOG(INFO) << "disallowing redirect: exceeds limit";
return net::ERR_TOO_MANY_REDIRECTS;