Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Unified Diff: net/http/http_stream_parser.cc

Issue 6488010: Propagate the remote socket address to URLRequest and to ViewHostMsg_FrameNavigate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/http/http_stream_parser.cc
diff --git a/net/http/http_stream_parser.cc b/net/http/http_stream_parser.cc
index 20ebd87ed9e315847a8d501c8181b5dbcb45f2ab..bfea126bd6c6458ef4f3a41561076ebb815247fc 100644
--- a/net/http/http_stream_parser.cc
+++ b/net/http/http_stream_parser.cc
@@ -6,8 +6,10 @@
#include "base/compiler_specific.h"
#include "base/metrics/histogram.h"
+#include "net/base/address_list.h"
#include "net/base/auth.h"
#include "net/base/io_buffer.h"
+#include "net/base/net_util.h"
#include "net/base/ssl_cert_request_info.h"
#include "net/http/http_net_log_params.h"
#include "net/http/http_request_headers.h"
@@ -65,6 +67,14 @@ int HttpStreamParser::SendRequest(const std::string& request_line,
request_line, headers)));
}
response_ = response;
+
+ // Put the peer's ip:port into the response, for inquisitive users.
+ AddressList address;
+ if (connection_->socket()->GetPeerAddress(&address) == OK)
+ response_->socket_address = NetAddressToStringWithPort(address.head());
+ else
+ response_->socket_address.clear();
+
std::string request = request_line + headers.ToString();
scoped_refptr<StringIOBuffer> headers_io_buf(new StringIOBuffer(request));
request_headers_ = new DrainableIOBuffer(headers_io_buf,

Powered by Google App Engine
This is Rietveld 408576698