diff options
author | bryner@chromium.org <bryner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-22 19:47:19 +0000 |
---|---|---|
committer | bryner@chromium.org <bryner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-22 19:47:19 +0000 |
commit | 6d81b488e8cc5e10eaeca0a4ee4819dc3f469a24 (patch) | |
tree | e628aa40ac26d26a6a9a46374001be983e7a7f41 /net/ftp/ftp_network_transaction.cc | |
parent | f19572134235f4cceb76e85e1c064ba668bbd3bd (diff) | |
download | chromium_src-6d81b488e8cc5e10eaeca0a4ee4819dc3f469a24.zip chromium_src-6d81b488e8cc5e10eaeca0a4ee4819dc3f469a24.tar.gz chromium_src-6d81b488e8cc5e10eaeca0a4ee4819dc3f469a24.tar.bz2 |
Propagate the remote socket address to URLRequest and to ViewHostMsg_FrameNavigate.
This will be used to run pre-classification checks for client-side phishing
detection, and will also enable the socket address to be exposed via the
webRequest extension API. This is adapted from the original patch by pmarks
on http://codereview.chromium.org/6369003/ .
BUG=51663
TEST=added socket address checks to various unittests
Review URL: http://codereview.chromium.org/6488010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75620 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/ftp/ftp_network_transaction.cc')
-rw-r--r-- | net/ftp/ftp_network_transaction.cc | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/net/ftp/ftp_network_transaction.cc b/net/ftp/ftp_network_transaction.cc index d012818..3f35c83 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; } |