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

Unified Diff: net/ftp/ftp_network_transaction.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: Address eroman's comments 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/ftp/ftp_network_transaction.cc
diff --git a/net/ftp/ftp_network_transaction.cc b/net/ftp/ftp_network_transaction.cc
index d012818c2371ab65b443b0458b309de17dab5ffd..3f35c83ad4cd4708e01aa901f3aee97beb280e79 100644
--- a/net/ftp/ftp_network_transaction.cc
+++ b/net/ftp/ftp_network_transaction.cc
@@ -9,6 +9,7 @@
#include "base/string_number_conversions.h"
#include "base/string_util.h"
#include "base/utf_string_conversions.h"
+#include "net/base/address_list.h"
#include "net/base/connection_type_histograms.h"
#include "net/base/escape.h"
#include "net/base/net_errors.h"
@@ -620,8 +621,15 @@ int FtpNetworkTransaction::DoCtrlConnect() {
}
int FtpNetworkTransaction::DoCtrlConnectComplete(int result) {
- if (result == OK)
- next_state_ = STATE_CTRL_READ;
+ if (result == OK) {
+ // Put the peer's IP address and port into the response.
+ AddressList address;
+ result = ctrl_socket_->GetPeerAddress(&address);
+ if (result == OK) {
+ response_.socket_address = HostPortPair::FromAddrInfo(address.head());
+ next_state_ = STATE_CTRL_READ;
+ }
+ }
return result;
}

Powered by Google App Engine
This is Rietveld 408576698