OLD | NEW |
---|---|
1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. Use of this | 1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. Use of this |
2 // source code is governed by a BSD-style license that can be found in the | 2 // source code is governed by a BSD-style license that can be found in the |
3 // LICENSE file. | 3 // LICENSE file. |
4 | 4 |
5 #include "net/ftp/ftp_network_transaction.h" | 5 #include "net/ftp/ftp_network_transaction.h" |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "net/base/connection_type_histograms.h" | 9 #include "net/base/connection_type_histograms.h" |
10 #include "net/base/load_log.h" | 10 #include "net/base/load_log.h" |
(...skipping 963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
974 next_state_ = STATE_CTRL_WRITE_SIZE; | 974 next_state_ = STATE_CTRL_WRITE_SIZE; |
975 } | 975 } |
976 return OK; | 976 return OK; |
977 } | 977 } |
978 | 978 |
979 int FtpNetworkTransaction::DoDataRead() { | 979 int FtpNetworkTransaction::DoDataRead() { |
980 DCHECK(read_data_buf_); | 980 DCHECK(read_data_buf_); |
981 DCHECK_GT(read_data_buf_len_, 0); | 981 DCHECK_GT(read_data_buf_len_, 0); |
982 | 982 |
983 if (data_socket_ == NULL || !data_socket_->IsConnected()) { | 983 if (data_socket_ == NULL || !data_socket_->IsConnected()) { |
984 // If we don't destroy the data socket completely, some servers will wait | |
wtc
2009/09/09 20:20:42
It would be nice to explain that a half-closed TCP
| |
985 // for us (http://crbug.com/21127). | |
986 data_socket_.reset(); | |
987 | |
984 // No more data so send QUIT Command now and wait for response. | 988 // No more data so send QUIT Command now and wait for response. |
985 return Stop(OK); | 989 return Stop(OK); |
986 } | 990 } |
987 | 991 |
988 next_state_ = STATE_DATA_READ_COMPLETE; | 992 next_state_ = STATE_DATA_READ_COMPLETE; |
989 read_data_buf_->data()[0] = 0; | 993 read_data_buf_->data()[0] = 0; |
990 return data_socket_->Read(read_data_buf_, read_data_buf_len_, | 994 return data_socket_->Read(read_data_buf_, read_data_buf_len_, |
991 &io_callback_); | 995 &io_callback_); |
992 } | 996 } |
993 | 997 |
994 int FtpNetworkTransaction::DoDataReadComplete(int result) { | 998 int FtpNetworkTransaction::DoDataReadComplete(int result) { |
995 return result; | 999 return result; |
996 } | 1000 } |
997 | 1001 |
998 } // namespace net | 1002 } // namespace net |
OLD | NEW |