Chromium Code Reviews| Index: net/http/http_stream_parser.cc |
| diff --git a/net/http/http_stream_parser.cc b/net/http/http_stream_parser.cc |
| index 5bf667183b06a4d023ed5984fcc74e9bc1325859..31ce76b3bf7e32e7e41b0b8fde09dc2af51a8fc5 100644 |
| --- a/net/http/http_stream_parser.cc |
| +++ b/net/http/http_stream_parser.cc |
| @@ -20,6 +20,23 @@ |
| #include "net/socket/ssl_client_socket.h" |
| #include "net/socket/client_socket_handle.h" |
| +namespace { |
| + |
| +std::string GetResponseHeaderLines(const net::HttpResponseHeaders& headers) { |
| + std::string raw_headers = headers.raw_headers(); |
| + const char* null_separated_headers = raw_headers.c_str(); |
| + const char* header_line = null_separated_headers; |
| + std::string cr_separated_headers; |
| + while (header_line[0] != 0) { |
| + cr_separated_headers += header_line; |
| + cr_separated_headers += "\n"; |
| + header_line += strlen(header_line) + 1; |
| + } |
| + return cr_separated_headers; |
| +} |
| + |
| +} // namespace |
| + |
| namespace net { |
| HttpStreamParser::HttpStreamParser(ClientSocketHandle* connection, |
| @@ -70,6 +87,9 @@ int HttpStreamParser::SendRequest(const std::string& request_line, |
| make_scoped_refptr(new NetLogHttpRequestParameter( |
| request_line, headers))); |
| } |
| + DVLOG(1) << __FUNCTION__ << "()" |
| + << " request_line = \"" << request_line << "\"" |
| + << " headers = \"" << headers.ToString() << "\""; |
| response_ = response; |
| // Put the peer's IP address and port into the response. |
| @@ -620,6 +640,11 @@ int HttpStreamParser::DoParseResponseHeaders(int end_offset) { |
| response_->headers = headers; |
| response_->vary_data.Init(*request_, *response_->headers); |
| + DVLOG(1) << __FUNCTION__ << "()" |
| + << " content_length = \"" |
| + << response_->headers->GetContentLength() << "\n\"" |
| + << " headers = \"" << GetResponseHeaderLines(*response_->headers) |
|
willchan no longer on Chromium
2011/05/23 22:12:26
Nit: Why not just use response_->headers.raw_heade
ahendrickson
2011/05/24 04:58:37
Because the headers are separated by NULL characte
|
| + << "\""; |
| return OK; |
| } |