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

Unified Diff: net/ftp/ftp_network_transaction.cc

Issue 11418035: FTP: Only issue EPSV command for non-IPv4 connections. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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
« no previous file with comments | « no previous file | net/ftp/ftp_network_transaction_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/ftp/ftp_network_transaction.cc
diff --git a/net/ftp/ftp_network_transaction.cc b/net/ftp/ftp_network_transaction.cc
index 272f49fbee8ed9316ffc916dd40b0318d2906f0a..c4b2181b9b1e5ad26613649a26e8b40cf8f88f57 100644
--- a/net/ftp/ftp_network_transaction.cc
+++ b/net/ftp/ftp_network_transaction.cc
@@ -682,6 +682,15 @@ int FtpNetworkTransaction::DoCtrlConnectComplete(int result) {
if (result == OK) {
response_.socket_address = HostPortPair::FromIPEndPoint(ip_endpoint);
next_state_ = STATE_CTRL_READ;
+
+ if (ip_endpoint.GetFamily() == AF_INET) {
+ // Do not use EPSV for IPv4 connections. Some servers become confused
+ // and we time out while waiting to connect. PASV is perfectly fine for
+ // IPv4. Note that this blacklists IPv4 not to use EPSV instead of
+ // whitelisting IPv6 to use it, to make the code more future-proof:
+ // all future protocols should just use EPSV.
+ use_epsv_ = false;
+ }
}
}
return result;
« no previous file with comments | « no previous file | net/ftp/ftp_network_transaction_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698