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

Side by Side Diff: net/ftp/ftp_network_transaction.cc

Issue 11528012: [net] Make IPEndPoint::GetFamily() return AddressFamily and add GetSockAddrFamily() to be used when… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update uses of GetFamily in net/dns/ Created 8 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/dns/dns_config_service_win.cc ('k') | net/socket/socks_client_socket.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/ftp/ftp_network_transaction.h" 5 #include "net/ftp/ftp_network_transaction.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after
676 676
677 int FtpNetworkTransaction::DoCtrlConnectComplete(int result) { 677 int FtpNetworkTransaction::DoCtrlConnectComplete(int result) {
678 if (result == OK) { 678 if (result == OK) {
679 // Put the peer's IP address and port into the response. 679 // Put the peer's IP address and port into the response.
680 IPEndPoint ip_endpoint; 680 IPEndPoint ip_endpoint;
681 result = ctrl_socket_->GetPeerAddress(&ip_endpoint); 681 result = ctrl_socket_->GetPeerAddress(&ip_endpoint);
682 if (result == OK) { 682 if (result == OK) {
683 response_.socket_address = HostPortPair::FromIPEndPoint(ip_endpoint); 683 response_.socket_address = HostPortPair::FromIPEndPoint(ip_endpoint);
684 next_state_ = STATE_CTRL_READ; 684 next_state_ = STATE_CTRL_READ;
685 685
686 if (ip_endpoint.GetFamily() == AF_INET) { 686 if (ip_endpoint.GetFamily() == ADDRESS_FAMILY_IPV4) {
687 // Do not use EPSV for IPv4 connections. Some servers become confused 687 // Do not use EPSV for IPv4 connections. Some servers become confused
688 // and we time out while waiting to connect. PASV is perfectly fine for 688 // and we time out while waiting to connect. PASV is perfectly fine for
689 // IPv4. Note that this blacklists IPv4 not to use EPSV instead of 689 // IPv4. Note that this blacklists IPv4 not to use EPSV instead of
690 // whitelisting IPv6 to use it, to make the code more future-proof: 690 // whitelisting IPv6 to use it, to make the code more future-proof:
691 // all future protocols should just use EPSV. 691 // all future protocols should just use EPSV.
692 use_epsv_ = false; 692 use_epsv_ = false;
693 } 693 }
694 } 694 }
695 } 695 }
696 return result; 696 return result;
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after
1387 if (!had_error_type[type]) { 1387 if (!had_error_type[type]) {
1388 had_error_type[type] = true; 1388 had_error_type[type] = true;
1389 UMA_HISTOGRAM_ENUMERATION("Net.FtpDataConnectionErrorHappened", 1389 UMA_HISTOGRAM_ENUMERATION("Net.FtpDataConnectionErrorHappened",
1390 type, NUM_OF_NET_ERROR_TYPES); 1390 type, NUM_OF_NET_ERROR_TYPES);
1391 } 1391 }
1392 UMA_HISTOGRAM_ENUMERATION("Net.FtpDataConnectionErrorCount", 1392 UMA_HISTOGRAM_ENUMERATION("Net.FtpDataConnectionErrorCount",
1393 type, NUM_OF_NET_ERROR_TYPES); 1393 type, NUM_OF_NET_ERROR_TYPES);
1394 } 1394 }
1395 1395
1396 } // namespace net 1396 } // namespace net
OLDNEW
« no previous file with comments | « net/dns/dns_config_service_win.cc ('k') | net/socket/socks_client_socket.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698