From 7b7d41fc206600571a3352e83a27334ad81775f2 Mon Sep 17 00:00:00 2001 From: "hclam@chromium.org" Date: Fri, 23 Jan 2009 00:27:53 +0000 Subject: 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 --- net/url_request/url_request_ftp_job.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'net/url_request') 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; -- cgit v1.1