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

Unified Diff: net/ftp/ftp_network_transaction.cc

Issue 207014: Various cleanups FTP-related. (Closed)
Patch Set: Created 11 years, 3 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 753aee25aed28b943fa7c2beb9decad69e5837b6..e1a4114caf6ac340966f4bc2605381e979460ee1 100644
--- a/net/ftp/ftp_network_transaction.cc
+++ b/net/ftp/ftp_network_transaction.cc
@@ -865,7 +865,10 @@ int FtpNetworkTransaction::ProcessResponseRETR(
DCHECK(!retr_failed_); // Should not get here twice.
retr_failed_ = true;
- next_state_ = STATE_CTRL_WRITE_PASV;
+
+ // It's possible that RETR failed because the path is a directory.
+ // Try CWD next, to see if that's the case.
+ next_state_ = STATE_CTRL_WRITE_CWD;
break;
default:
NOTREACHED();
@@ -1023,7 +1026,8 @@ int FtpNetworkTransaction::DoDataRead() {
if (data_socket_ == NULL || !data_socket_->IsConnected()) {
// If we don't destroy the data socket completely, some servers will wait
- // for us (http://crbug.com/21127).
+ // for us (http://crbug.com/21127). The half-closed TCP connection needs
+ // to be closed on our side too.
data_socket_.reset();
// No more data so send QUIT Command now and wait for response.

Powered by Google App Engine
This is Rietveld 408576698