diff options
author | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-02 08:25:50 +0000 |
---|---|---|
committer | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-02 08:25:50 +0000 |
commit | 071990ccaf6a865287b62a387ed729a6c261a50f (patch) | |
tree | a99e3d039701d2520ba113a1da940a7c5fff2369 /net/ftp/ftp_network_transaction.cc | |
parent | 56a6f0fd7b3f731f85e902d13f5658817a89dbbf (diff) | |
download | chromium_src-071990ccaf6a865287b62a387ed729a6c261a50f.zip chromium_src-071990ccaf6a865287b62a387ed729a6c261a50f.tar.gz chromium_src-071990ccaf6a865287b62a387ed729a6c261a50f.tar.bz2 |
Correctly handle FTP servers which unexpectedly close the control connection.
TEST=Covered by net_unittests.
BUG=25023
Review URL: http://codereview.chromium.org/340054
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30693 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/ftp/ftp_network_transaction.cc')
-rw-r--r-- | net/ftp/ftp_network_transaction.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/net/ftp/ftp_network_transaction.cc b/net/ftp/ftp_network_transaction.cc index 03a1291..a4d0a73 100644 --- a/net/ftp/ftp_network_transaction.cc +++ b/net/ftp/ftp_network_transaction.cc @@ -522,6 +522,14 @@ int FtpNetworkTransaction::DoCtrlRead() { } int FtpNetworkTransaction::DoCtrlReadComplete(int result) { + if (result == 0) { + // Some servers (for example Pure-FTPd) apparently close the control + // connection when anonymous login is not permitted. For more details + // see http://crbug.com/25023. + if (command_sent_ == COMMAND_USER && username_ == L"anonymous") + response_.needs_auth = true; + return Stop(ERR_EMPTY_RESPONSE); + } if (result < 0) return Stop(result); |