summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-23 00:27:53 +0000
committerhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-23 00:27:53 +0000
commit7b7d41fc206600571a3352e83a27334ad81775f2 (patch)
treefb8dcf4045ba0f619c37b04aaf97b8ea56dcedf0 /net
parent0049398c72b3fd711c825d477e0db6943f8f5db6 (diff)
downloadchromium_src-7b7d41fc206600571a3352e83a27334ad81775f2.zip
chromium_src-7b7d41fc206600571a3352e83a27334ad81775f2.tar.gz
chromium_src-7b7d41fc206600571a3352e83a27334ad81775f2.tar.bz2
BUG=1112
LGTMed in http://codereview.chromium.org/14831/show, just switched to git.. Review URL: http://codereview.chromium.org/18520 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8526 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r--net/url_request/url_request_ftp_job.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/net/url_request/url_request_ftp_job.cc b/net/url_request/url_request_ftp_job.cc
index d63d248..465217d 100644
--- a/net/url_request/url_request_ftp_job.cc
+++ b/net/url_request/url_request_ftp_job.cc
@@ -223,12 +223,16 @@ void URLRequestFtpJob::OnIOComplete(const AsyncResult& result) {
} else if (state_ == SETTING_CUR_DIRECTORY) {
OnSetCurrentDirectory(result.dwError);
} else if (state_ == FINDING_FIRST_FILE) {
- if (result.dwError != ERROR_SUCCESS) {
+ // We don't fail here if result.dwError != ERROR_SUCCESS because
+ // getting an error here doesn't always mean the file is not found.
+ // FindFirstFileA() issue a LIST command and may fail on some
+ // ftp server when the requested object is a file. So ERROR_NO_MORE_FILES
+ // from FindFirstFileA() is not a reliable criteria for valid path
+ // or not, we should proceed optimistically by getting the file handle.
+ if (result.dwError != ERROR_SUCCESS &&
+ result.dwError != ERROR_NO_MORE_FILES) {
DWORD result_error = result.dwError;
CleanupConnection();
- // Fixup the error message from our directory/file guessing.
- if (!is_directory_ && result_error == ERROR_NO_MORE_FILES)
- result_error = ERROR_PATH_NOT_FOUND;
NotifyStartError(URLRequestStatus(URLRequestStatus::FAILED,
WinInetUtil::OSErrorToNetError(result_error)));
return;