summaryrefslogtreecommitdiffstats
path: root/net/ftp/ftp_network_transaction.cc
diff options
context:
space:
mode:
authorphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-18 16:29:53 +0000
committerphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-18 16:29:53 +0000
commitcca048bf67b8a044dc69c54f9fd691ef9143b865 (patch)
tree8f0ab3fade412b43b73fc98bcd1bf5a160c13ae9 /net/ftp/ftp_network_transaction.cc
parent8b30662b7ca998a481c9dae66d8b6b05db47b38a (diff)
downloadchromium_src-cca048bf67b8a044dc69c54f9fd691ef9143b865.zip
chromium_src-cca048bf67b8a044dc69c54f9fd691ef9143b865.tar.gz
chromium_src-cca048bf67b8a044dc69c54f9fd691ef9143b865.tar.bz2
Various cleanups FTP-related.
- use better name for FTP LIST parsing code in about:credits - don't open a second data socket - add a comment explaining why we close the data socket at one point TEST=Covered by net_unittests. BUG=none Review URL: http://codereview.chromium.org/207014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26575 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/ftp/ftp_network_transaction.cc')
-rw-r--r--net/ftp/ftp_network_transaction.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/net/ftp/ftp_network_transaction.cc b/net/ftp/ftp_network_transaction.cc
index 753aee2..e1a4114caf 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.