diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2008-06-28 08:54:54 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2008-06-28 08:54:54 +0000 |
| commit | dc59e6a2bb1272206dfd4cf21557c0e4e70fe74d (patch) | |
| tree | 8be60471ad83c65097b6d432093a6d69a4d397d8 /src/FtpConnection.cc | |
| parent | c42c8b7f9ca7d78c9aa1af505072e9ecf640373d (diff) | |
2008-06-28 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Disabled getting size from the response of RETR.
If SIZE command failed, then disable resuming and segmented
downloading.
* src/FtpConnection.cc
* src/FtpConnection.h
* src/FtpNegotiationCommand.cc
* src/FtpNegotiationCommand.h
Diffstat (limited to 'src/FtpConnection.cc')
| -rw-r--r-- | src/FtpConnection.cc | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/src/FtpConnection.cc b/src/FtpConnection.cc index f8598882..8a9062b3 100644 --- a/src/FtpConnection.cc +++ b/src/FtpConnection.cc @@ -283,34 +283,4 @@ unsigned int FtpConnection::receivePasvResponse(std::pair<std::string, uint16_t> } } -unsigned int FtpConnection::receiveRetrResponse(uint64_t& size) -{ - static const char* DIGITS = "0123456789"; - std::pair<unsigned int, std::string> response; - if(bulkReceiveResponse(response)) { - if(response.first == 150 || response.first == 125) { - // Attempting to get file size from the response. - // We assume the response is like: - // 150 Opening BINARY mode data connection for aria2.tar.bz2 (12345 bytes) - // If the attempt is failed, size is unchanged. - std::string& res = response.second; - std::string::size_type start; - if((start = res.find_first_of("(")) != std::string::npos && - (start = res.find_first_of(DIGITS, start)) != std::string::npos) { - - // now start points to the first digit of the size string. - std::string::size_type end = - res.find_first_not_of(DIGITS, start); - - if(end != std::string::npos) { - size = Util::parseULLInt(res.substr(start, end-start)); - } - } - } - return response.first; - } else { - return 0; - } -} - } // namespace aria2 |
