Chromium Code Reviews| 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..a7cb0fbe1c8511661501d7675927387eb28d5b28 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,16 @@ int FtpNetworkTransaction::DoCtrlConnect() { |
| } |
| int FtpNetworkTransaction::DoCtrlConnectComplete(int result) { |
| - if (result == OK) |
| + if (result == OK) { |
| next_state_ = STATE_CTRL_READ; |
| + // Store the socket address that we connected to. |
| + AddressList address; |
| + if (ctrl_socket_->GetPeerAddress(&address) == OK) { |
| + response_.socket_address = NetAddressToStringWithPort(address.head()); |
| + } else { |
| + response_.socket_address.clear(); |
|
Paweł Hajdan Jr.
2011/02/11 19:34:54
Do we really want it to be a silent failure? That
Brian Ryner
2011/02/11 23:01:07
GetPeerAddress does seem to occasionally return er
Paweł Hajdan Jr.
2011/02/14 09:10:03
The response seems to be missing the point. Maybe
|
| + } |
| + } |
| return result; |
| } |