| Index: net/url_request/url_request_ftp_job.cc
|
| diff --git a/net/url_request/url_request_ftp_job.cc b/net/url_request/url_request_ftp_job.cc
|
| index 2305c78480a8ea8f8f5990e13247c65d9eefe3a4..feb113dc736ae65a45675dce599763ddc1e640f3 100644
|
| --- a/net/url_request/url_request_ftp_job.cc
|
| +++ b/net/url_request/url_request_ftp_job.cc
|
| @@ -236,7 +236,7 @@ void URLRequestFtpJob::OnStartCompleted(int result) {
|
| HandleAuthNeededResponse();
|
| return;
|
| } else {
|
| - NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, result));
|
| + NotifyStartError(URLRequestStatus(URLRequestStatus::FAILED, result));
|
| }
|
| }
|
|
|
| @@ -248,15 +248,7 @@ void URLRequestFtpJob::OnStartCompletedAsync(int result) {
|
|
|
| void URLRequestFtpJob::OnReadCompleted(int result) {
|
| read_in_progress_ = false;
|
| - if (result == 0) {
|
| - NotifyDone(URLRequestStatus());
|
| - } else if (result < 0) {
|
| - NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, result));
|
| - } else {
|
| - // Clear the IO_PENDING status
|
| - SetStatus(URLRequestStatus());
|
| - }
|
| - NotifyReadComplete(result);
|
| + ReadRawDataComplete(result);
|
| }
|
|
|
| void URLRequestFtpJob::RestartTransactionWithAuth() {
|
| @@ -347,14 +339,12 @@ UploadProgress URLRequestFtpJob::GetUploadProgress() const {
|
| return UploadProgress();
|
| }
|
|
|
| -bool URLRequestFtpJob::ReadRawData(IOBuffer* buf,
|
| - int buf_size,
|
| - int *bytes_read) {
|
| +int URLRequestFtpJob::ReadRawData(IOBuffer* buf, int buf_size) {
|
| DCHECK_NE(buf_size, 0);
|
| - DCHECK(bytes_read);
|
| DCHECK(!read_in_progress_);
|
|
|
| int rv;
|
| +
|
| if (proxy_info_.is_direct()) {
|
| rv = ftp_transaction_->Read(buf, buf_size,
|
| base::Bind(&URLRequestFtpJob::OnReadCompleted,
|
| @@ -365,18 +355,9 @@ bool URLRequestFtpJob::ReadRawData(IOBuffer* buf,
|
| base::Unretained(this)));
|
| }
|
|
|
| - if (rv >= 0) {
|
| - *bytes_read = rv;
|
| - return true;
|
| - }
|
| -
|
| - if (rv == ERR_IO_PENDING) {
|
| + if (rv == ERR_IO_PENDING)
|
| read_in_progress_ = true;
|
| - SetStatus(URLRequestStatus(URLRequestStatus::IO_PENDING, 0));
|
| - } else {
|
| - NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, rv));
|
| - }
|
| - return false;
|
| + return rv;
|
| }
|
|
|
| void URLRequestFtpJob::HandleAuthNeededResponse() {
|
|
|