Chromium Code Reviews| Index: net/ftp/ftp_network_transaction.cc |
| diff --git a/net/ftp/ftp_network_transaction.cc b/net/ftp/ftp_network_transaction.cc |
| index b34511fa1527419f37ca87b059dd02b2fa7040b1..b5efb077482b5f7680b0dc4f3e3e2e8c7910a014 100644 |
| --- a/net/ftp/ftp_network_transaction.cc |
| +++ b/net/ftp/ftp_network_transaction.cc |
| @@ -417,7 +417,9 @@ int FtpNetworkTransaction::ProcessCtrlResponse() { |
| } |
| // We may get multiple responses for some commands, |
| - // see http://crbug.com/18036. |
| + // see http://crbug.com/18036. Consume all responses, regardless of whether |
| + // they make sense. On unexpected responses, SendFtpCommand expects all data |
| + // to have already been consumed, even when sending the QUIT command. |
|
mmenke
2016/11/28 17:28:22
Another option would be to skip that DCHECK in cas
|
| while (ctrl_response_buffer_->ResponseAvailable() && rv == OK) { |
| response = ctrl_response_buffer_->PopResponse(); |
| @@ -430,7 +432,8 @@ int FtpNetworkTransaction::ProcessCtrlResponse() { |
| break; |
| default: |
| // Multiple responses for other commands are invalid. |
| - return Stop(ERR_INVALID_RESPONSE); |
| + rv = Stop(ERR_INVALID_RESPONSE); |
|
eroman
2016/11/28 17:51:24
I am not sure I understand this code flow.
rv wil
mmenke
2016/11/28 18:21:01
Stop sets the next state to send the quit message,
|
| + break; |
| } |
| } |