diff options
author | ericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-29 22:06:06 +0000 |
---|---|---|
committer | ericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-29 22:06:06 +0000 |
commit | e887ca51ed126a1d9ff024619f461981542d0887 (patch) | |
tree | f1c9b411421fb48bcca55867fb8013c0a33ba9d6 /net | |
parent | 2a1752a2bc01b7fc391c5a11ee37f63f78832d67 (diff) | |
download | chromium_src-e887ca51ed126a1d9ff024619f461981542d0887.zip chromium_src-e887ca51ed126a1d9ff024619f461981542d0887.tar.gz chromium_src-e887ca51ed126a1d9ff024619f461981542d0887.tar.bz2 |
Temporary code instrumentation to gather info on a crash.
The idea is to see where in DidReadResponseHeaders() things blow up (if at all).
This hack adds a value at ebp+8 (parent's frame) which indicates where we were.
TBR=wtc
Review URL: http://codereview.chromium.org/8890
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4174 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r-- | net/http/http_network_transaction.cc | 33 | ||||
-rw-r--r-- | net/http/http_network_transaction.h | 2 |
2 files changed, 32 insertions, 3 deletions
diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc index cad17af..34a6605 100644 --- a/net/http/http_network_transaction.cc +++ b/net/http/http_network_transaction.cc @@ -688,7 +688,8 @@ int HttpNetworkTransaction::DoReadHeadersComplete(int result) { } // And, we are done with the Start or the SSL tunnel CONNECT sequence. - return DidReadResponseHeaders(); + int bug_3772_storage = 0; + return DidReadResponseHeaders(&bug_3772_storage); } int HttpNetworkTransaction::DoReadBody() { @@ -769,18 +770,28 @@ int HttpNetworkTransaction::DoReadBodyComplete(int result) { return result; } -int HttpNetworkTransaction::DidReadResponseHeaders() { +void Bug3772Set(int* storage, int x) { + *storage = 0xdeadbeef + x; +} + +int HttpNetworkTransaction::DidReadResponseHeaders(int* bug_3772_state) { + Bug3772Set(bug_3772_state, 0); + scoped_refptr<HttpResponseHeaders> headers; if (has_found_status_line_start()) { + Bug3772Set(bug_3772_state, 1); headers = new HttpResponseHeaders( HttpUtil::AssembleRawHeaders( header_buf_.get(), header_buf_body_offset_)); } else { + Bug3772Set(bug_3772_state, 2); // Fabricate a status line to to preserve the HTTP/0.9 version. // (otherwise HttpResponseHeaders will default it to HTTP/1.0). headers = new HttpResponseHeaders(std::string("HTTP/0.9 200 OK")); } + Bug3772Set(bug_3772_state, 3); + if (headers->GetParsedHttpVersion() < HttpVersion(1, 0)) { // Require the "HTTP/1.x" status line for SSL CONNECT. if (establishing_tunnel_) @@ -793,10 +804,13 @@ int HttpNetworkTransaction::DidReadResponseHeaders() { return ERR_METHOD_NOT_SUPPORTED; } + Bug3772Set(bug_3772_state, 4); + // Check for an intermediate 100 Continue response. An origin server is // allowed to send this response even if we didn't ask for it, so we just // need to skip over it. if (headers->response_code() == 100) { + Bug3772Set(bug_3772_state, 5); header_buf_len_ -= header_buf_body_offset_; // If we've already received some bytes after the 100 Continue response, // move them to the beginning of header_buf_. @@ -809,7 +823,10 @@ int HttpNetworkTransaction::DidReadResponseHeaders() { return OK; } + Bug3772Set(bug_3772_state, 6); + if (establishing_tunnel_ && headers->response_code() == 200) { + Bug3772Set(bug_3772_state, 7); if (header_buf_body_offset_ != header_buf_len_) { // The proxy sent extraneous data after the headers. return ERR_TUNNEL_CONNECTION_FAILED; @@ -824,15 +841,21 @@ int HttpNetworkTransaction::DidReadResponseHeaders() { return OK; } + Bug3772Set(bug_3772_state, 8); + response_.headers = headers; response_.vary_data.Init(*request_, *response_.headers); + Bug3772Set(bug_3772_state, 9); + int rv = PopulateAuthChallenge(); if (rv != OK) return rv; // Figure how to determine EOF: + Bug3772Set(bug_3772_state, 10); + // For certain responses, we know the content length is always 0. switch (response_.headers->response_code()) { case 204: // No Content @@ -843,6 +866,7 @@ int HttpNetworkTransaction::DidReadResponseHeaders() { } if (content_length_ == -1) { + Bug3772Set(bug_3772_state, 11); // Ignore spurious chunked responses from HTTP/1.0 servers and proxies. // Otherwise "Transfer-Encoding: chunked" trumps "Content-Length: N" if (response_.headers->GetHttpVersion() >= HttpVersion(1, 1) && @@ -855,12 +879,17 @@ int HttpNetworkTransaction::DidReadResponseHeaders() { } } + Bug3772Set(bug_3772_state, 12); + if (using_ssl_ && !establishing_tunnel_) { + Bug3772Set(bug_3772_state, 13); SSLClientSocket* ssl_socket = reinterpret_cast<SSLClientSocket*>(connection_.socket()); ssl_socket->GetSSLInfo(&response_.ssl_info); } + Bug3772Set(bug_3772_state, 14); + return OK; } diff --git a/net/http/http_network_transaction.h b/net/http/http_network_transaction.h index 86c613f..7fb579a 100644 --- a/net/http/http_network_transaction.h +++ b/net/http/http_network_transaction.h @@ -78,7 +78,7 @@ class HttpNetworkTransaction : public HttpTransaction { int DoReadBodyComplete(int result); // Called when header_buf_ contains the complete response headers. - int DidReadResponseHeaders(); + int DidReadResponseHeaders(int* /*temp hack*/); // Called to handle a certificate error. Returns OK if the error should be // ignored. Otherwise, stores the certificate in response_.ssl_info and |