Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(350)

Unified Diff: net/ftp/ftp_network_transaction.cc

Issue 118459: Fix FTP binary file download issue.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/ftp/ftp_network_transaction.cc
===================================================================
--- net/ftp/ftp_network_transaction.cc (revision 17917)
+++ net/ftp/ftp_network_transaction.cc (working copy)
@@ -693,10 +693,9 @@
int FtpNetworkTransaction::ProcessResponseRETR(int response_code) {
switch (GetErrorClass(response_code)) {
case ERROR_CLASS_INITIATED:
- next_state_ = STATE_CTRL_WRITE_QUIT;
break;
case ERROR_CLASS_OK:
- next_state_ = STATE_DATA_RESOLVE_HOST;
+ next_state_ = STATE_CTRL_WRITE_QUIT;
break;
case ERROR_CLASS_PENDING:
next_state_ = STATE_CTRL_WRITE_PASV;
@@ -706,6 +705,8 @@
return Stop(ERR_FAILED);
return ERR_FAILED; // TODO(ibrar): Retry here.
case ERROR_CLASS_ERROR:
+ if (retr_failed_)
+ return Stop(ERR_FAILED);
retr_failed_ = true;
next_state_ = STATE_CTRL_WRITE_PASV;
break;
@@ -825,6 +826,9 @@
// Data Connection
int FtpNetworkTransaction::DoDataResolveHost() {
+ if (data_socket_ != NULL && data_socket_->IsConnected())
+ data_socket_->Disconnect();
+
next_state_ = STATE_DATA_RESOLVE_HOST_COMPLETE;
DidStartDnsResolution(data_connection_ip_, this);
@@ -843,9 +847,6 @@
}
int FtpNetworkTransaction::DoDataConnect() {
- if (data_socket_ != NULL && data_socket_->IsConnected())
- data_socket_->Disconnect();
-
next_state_ = STATE_DATA_CONNECT_COMPLETE;
data_socket_.reset(socket_factory_->CreateTCPClientSocket(addresses_));
return data_socket_->Connect(&io_callback_);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698