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

Unified Diff: net/ftp/ftp_network_transaction.cc

Issue 3012028: Recommit r53882 "FTP: fix navigation to systems with broken EPSV support."i" (Closed)
Patch Set: Created 10 years, 5 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
« no previous file with comments | « no previous file | no next file » | 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 f6b7203b0316fc52508cbf23bc4633ee218bd182..471e8c920842dbf45891ad4c9ab3fc3bb247a164 100644
--- a/net/ftp/ftp_network_transaction.cc
+++ b/net/ftp/ftp_network_transaction.cc
@@ -1187,7 +1187,22 @@ int FtpNetworkTransaction::DoDataConnect() {
}
int FtpNetworkTransaction::DoDataConnectComplete(int result) {
+ if (result == ERR_CONNECTION_TIMED_OUT && use_epsv_) {
+ // It's possible we hit a broken server, sadly. Fall back to PASV.
+ // TODO(phajdan.jr): remember it for future transactions with this server.
+ // TODO(phajdan.jr): write a test for this code path.
+ use_epsv_ = false;
+ next_state_ = STATE_CTRL_WRITE_PASV;
+ return OK;
+ }
+
+ // Only record the connection error after we've applied all our fallbacks.
+ // We want to capture the final error, one we're not going to recover from.
RecordDataConnectionError(result);
+
+ if (result != OK)
+ return Stop(result);
+
next_state_ = STATE_CTRL_WRITE_SIZE;
return OK;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698