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

Unified Diff: net/ftp/ftp_network_transaction.cc

Issue 10309002: Reimplements net::AddressList without struct addrinfo. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added missing NET_EXPORT to *PortOnAddressList. Created 8 years, 8 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 322764f6fec318f71e682deb03f82053e94bafb3..c57bf8b8442edf90ef904d4747240a324448d570 100644
--- a/net/ftp/ftp_network_transaction.cc
+++ b/net/ftp/ftp_network_transaction.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -654,7 +654,7 @@ int FtpNetworkTransaction::DoCtrlConnectComplete(int result) {
AddressList address;
result = ctrl_socket_->GetPeerAddress(&address);
if (result == OK) {
- response_.socket_address = HostPortPair::FromAddrInfo(address.head());
+ response_.socket_address = HostPortPair::FromIPEndPoint(address[0]);
eroman 2012/05/04 01:08:41 Here for instance code assumes that on success Add
szym 2012/05/04 02:38:29 Both HostResolverImpl and its tests assume that OK
next_state_ = STATE_CTRL_READ;
}
}
@@ -1194,7 +1194,8 @@ int FtpNetworkTransaction::DoDataConnect() {
int rv = ctrl_socket_->GetPeerAddress(&data_address);
if (rv != OK)
return Stop(rv);
- data_address.SetPort(data_connection_port_);
+ data_address = AddressList::CreateFromIPAddress(
eroman 2012/05/04 01:08:41 This is a bit awkward. How about just calling the
szym 2012/05/04 02:38:29 The awkwardness comes from the immutability of IPE
eroman 2012/05/04 04:20:22 Ah. In that case I agree this is fine; no point ch
+ data_address[0].address(), data_connection_port_);
data_socket_.reset(socket_factory_->CreateTransportClientSocket(
data_address, net_log_.net_log(), net_log_.source()));
return data_socket_->Connect(io_callback_);

Powered by Google App Engine
This is Rietveld 408576698