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. |