diff options
-rw-r--r-- | net/socket/tcp_client_socket_pool.cc | 10 | ||||
-rw-r--r-- | net/url_request/url_request.cc | 7 |
2 files changed, 17 insertions, 0 deletions
diff --git a/net/socket/tcp_client_socket_pool.cc b/net/socket/tcp_client_socket_pool.cc index a64c073..a4e5bec 100644 --- a/net/socket/tcp_client_socket_pool.cc +++ b/net/socket/tcp_client_socket_pool.cc @@ -7,6 +7,7 @@ #include "base/compiler_specific.h" #include "base/logging.h" #include "base/message_loop.h" +#include "base/string_util.h" #include "base/time.h" #include "net/base/load_log.h" #include "net/base/net_errors.h" @@ -189,6 +190,15 @@ int TCPClientSocketPool::RequestSocket( LoadLog* load_log) { const HostResolver::RequestInfo* casted_resolve_info = static_cast<const HostResolver::RequestInfo*>(resolve_info); + + if (LoadLog::IsUnbounded(load_log)) { + LoadLog::AddString( + load_log, + StringPrintf("Requested TCP socket to: %s [port %d]", + casted_resolve_info->hostname().c_str(), + casted_resolve_info->port())); + } + return base_.RequestSocket( group_name, *casted_resolve_info, priority, handle, callback, load_log); } 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; |