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

Unified Diff: net/spdy/spdy_http_stream.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/spdy/spdy_http_stream.cc
diff --git a/net/spdy/spdy_http_stream.cc b/net/spdy/spdy_http_stream.cc
index 6a6abb241f84a1bd83a07c0d3ae822a3a1ffdae4..748767b1f118084405150da381b4c10f452c18cf 100644
--- a/net/spdy/spdy_http_stream.cc
+++ b/net/spdy/spdy_http_stream.cc
@@ -10,6 +10,7 @@
#include "base/logging.h"
#include "base/message_loop.h"
+#include "net/base/address_list.h"
#include "net/base/load_flags.h"
#include "net/base/net_util.h"
#include "net/http/http_request_headers.h"
@@ -230,6 +231,15 @@ int SpdyHttpStream::SendRequest(const HttpRequestHeaders& request_headers,
response_info_ = response;
+ // Put the peer's ip:port into the response, for inquisitive users.
+ AddressList address;
+ if (stream_->GetPeerAddress(&address) == OK) {
+ response_info_->socket_address =
+ NetAddressToStringWithPort(address.head());
+ } else {
+ response_info_->socket_address.clear();
+ }
+
bool has_upload_data = request_body_stream_.get() != NULL;
int result = stream_->SendRequest(has_upload_data);
if (result == ERR_IO_PENDING) {

Powered by Google App Engine
This is Rietveld 408576698