summaryrefslogtreecommitdiff
path: root/src/AbstractCommand.cc
Commit message (Collapse)AuthorAgeFilesLines
* WinTLS: Fix hang because of buffered received dataTatsuhiro Tsujikawa2016-01-301-1/+6
| | | | | | | | | | | | | WinTLSSession buffers received decrypted data into its own buffer. If read is requested, it copies the data from its buffer. But if requested buffer size is less than decrypted buffer, some of the data is left in the buffer. Previously, we had no facility to check the existence of this pending data. If this data is the last requested data from remote server, we may end up waiting for read event even if we have already data in our buffer, which may cause hang. This commit fixes this issue by introducing function to return the buffered length in TLSSession. SocketCore also provides the same function, which delegates to TLSSession object.
* make clang-format using clang-format-3.6Tatsuhiro Tsujikawa2015-12-271-121/+95
|
* Send the last error message as part of tellStatus RPC responseJarda Snajdr2015-11-181-3/+3
|
* Use user-defined literals for time unitsTatsuhiro Tsujikawa2015-06-211-2/+1
|
* Use std::begin and std::endTatsuhiro Tsujikawa2015-06-111-14/+8
|
* Replace timer facility with chrono libTatsuhiro Tsujikawa2015-06-091-5/+7
|
* sftp: basic download worksTatsuhiro Tsujikawa2015-05-121-2/+3
| | | | | | This commits implements basic downloading feature for sftp URI. This includes segmented downloads, and connection (sftp session) pooling. Download via HTTP proxy has not been implemented yet.
* Use std::make_shared and make_unique where possible, part 1Tatsuhiro Tsujikawa2014-09-131-2/+2
|
* Fix std::length_error when no_proxy is usedTatsuhiro Tsujikawa2014-07-261-0/+2
| | | | This is regression introduced in 8cada497.
* Revert to existing "proper" coding styleTatsuhiro Tsujikawa2014-06-031-57/+57
| | | | | The rule is simple: don't try to change the coding style of the existing codebase.
* Cleanup AbstractCommand take 2Nils Maier2014-05-291-439/+505
| | | | | | Decided to keep the 'if(' -> 'if (' stuff, as I formatted the whole file and so it is internally consistent within the file. Also, too much hassle.
* Revert "Cleanup AbstractCommand"Nils Maier2014-05-291-501/+439
| | | | This reverts commit 0465aa54557e802156d1df0661c29d2aadb5541d.
* Cleanup AbstractCommandNils Maier2014-05-271-439/+501
| | | | | | | In my quest to explore the code and understand it, why not clean it up in the progress. Most formatting provided by clang-format. ;) Aside from formatting, also extracted some method and unnested some control structs.
* Remove ENABLE_MESSAGE_DIGEST, since we got the internal md, alwaysNils Maier2014-04-171-3/+1
|
* Stuff memory holesNils Maier2013-12-091-16/+19
| | | | | | | | | | | | | | | | | | Padding changes on x86_64: - RequestGroup: 29 -> 5 bytes - DownloadContext: 25 -> 1 bytes - Cookie: 20 -> 4 bytes - Command: 8 -> 0 bytes (affects many derived as well) - HttpRequest: 20 -> 4 bytes - DownloadCommand: 18 -> 2 bytes - TimeBasedCommand: 14 -> 6 bytes - AbstractCommand: 13 -> 5 bytes - HttpSkipResponseCommand: 12 -> 4 bytes - FileEntry: 10 -> 2 bytes - DownloadResult: 15 -> 7 bytes - UriStruct: 12 -> 4 bytes - Piece: 11 -> 3 bytes - BitfieldMan -> 11 -> 3 bytes
* Introduce PrefPtr typedefNils Maier2013-09-191-6/+6
|
* Use std::unique_ptr for CheckIntegrityEntry and FileAllocationEntryTatsuhiro Tsujikawa2013-07-061-2/+3
|
* Use std::unique_ptr for AsyncResolverManTatsuhiro Tsujikawa2013-07-031-1/+1
|
* Wrap Command object in std::unique_ptrTatsuhiro Tsujikawa2013-06-231-20/+20
|
* Use std::mem_fn instead of std::mem_funTatsuhiro Tsujikawa2013-06-221-1/+1
|
* Require -std=c++11 and use std::shared_ptr instead of SharedHandleTatsuhiro Tsujikawa2013-06-221-28/+28
|
* Rewrite backup connection handlingTatsuhiro Tsujikawa2013-04-011-0/+7
| | | | | | | Now dedicated ConnectCommand handles connection establishment. It checks whether connection is established or not. It also handles backup connection. The next Command creation is abstracted using ControlChain struct template.
* Use AsyncNameResolverMan in DHTEntryPointNameResolveCommandTatsuhiro Tsujikawa2013-04-011-7/+1
|
* Implement simple Happy Eyeballs for HTTP/FTP downloadsTatsuhiro Tsujikawa2013-04-011-1/+1
|
* Use GetAdaptersAddresses for MingwTatsuhiro Tsujikawa2013-03-311-0/+6
|
* Check non-loopback (and non-linklocak for IPv6) address is configuredTatsuhiro Tsujikawa2013-03-311-1/+5
| | | | | | Issue A record query only when non-loopback IPv4 address is configured. Likewise, issue AAA record query only when non-loopback and non-linklocak IPv6 address is configured.
* Parallel A and AAAA record lookups with c-aresTatsuhiro Tsujikawa2013-03-311-90/+33
|
* Start to find faster host before the number of missing segments becomes 1Tatsuhiro Tsujikawa2012-12-071-2/+3
| | | | | | | | | | The old implementation starts to find faster host when the number of missing segment becomes 1. Because of --min-split-size option, before the number of missing segment becomes 1, the number of connection becomes 1 and it can be slow. In this case, we have to wait until the last segment is reached. The new implementation starts to find faster host when the remaining length is less than --min-split-size * 2, to mitigate the problem stated above.
* Reworked download/upload statistics calculationTatsuhiro Tsujikawa2012-10-251-1/+1
| | | | | | | | | | | | | | The old implementation calculates download/upload statistics for a RequestGroup by summing up all PeerStat objects. For global statistics, those are summed together. This clearly incurs runtime penalty and we introduced some kind of caching which updates statistics every 250ms but it did not work right. This change removes all these aggregation code, and instead makes RequestGroup and RequestGroupMan objects hold NetStat object and download/upload bytes are directly calculated by thier own NetStat. This is far more simplar than the old way and less runtime penalty and brings more accuracy.
* Removed socket readability check from checkIfConnectionEstablished()Tatsuhiro Tsujikawa2012-10-151-25/+23
|
* Removed *Handle typedefTatsuhiro Tsujikawa2012-09-281-5/+7
|
* Removed Request::PROTO_*Tatsuhiro Tsujikawa2012-09-251-4/+4
|
* Fixed assertion error if --retry-wait is usedTatsuhiro Tsujikawa2012-08-311-0/+5
| | | | | | | | In CreateRequestCommand, if Request object returned from getRequest() is still sleeping, CreateRequestCommand pools it back but still holds its reference. This makes assertion error in UnknownLengthPieceStroage::hasMissingUnusedPiece() from AbstractCommand::execute().
* Use PRId64 for int64_t format specifierTatsuhiro Tsujikawa2012-06-251-15/+15
|
* Use int instead of unsigned int where unsigned int is not needed.Tatsuhiro Tsujikawa2011-12-091-1/+1
|
* Use int32_t for piece length instead of size_tTatsuhiro Tsujikawa2011-12-091-1/+1
|
* Made notice level log messages translatableTatsuhiro Tsujikawa2011-12-021-2/+2
|
* Proxy URI is now constructed in getProxyUri().Tatsuhiro Tsujikawa2011-11-131-16/+52
| | | | | | | | | | The previous implementation constructs proxy URI in OptionHandler but it cannot handle with the situation when user, password and proxy URI is given various order. Now we just set rules: username set in --*-proxy-user overrides username in --*-proxy option, no matter in any order username, password and proxy URI are parsed. Likewise, password set in --*--proxy-passwd overrides password in --*-proxy option.
* Rewritten parse*IntTatsuhiro Tsujikawa2011-11-121-1/+1
|
* Rewritten util::split and added its iterator version.Tatsuhiro Tsujikawa2011-11-041-8/+11
| | | | | Iterator based functions util::startsWith, util::endsWith, util::streq, util::strieq were added.
* Changed parse*Int functions so that it accepts iterators.Tatsuhiro Tsujikawa2011-11-031-1/+1
|
* Use same domain-match algorithm for no-proxy and netrc.Tatsuhiro Tsujikawa2011-10-291-24/+1
| | | | | Now "example.org" does not domain-match ".example.org" in both functions.
* Rewritten Option. Introduced Pref.Tatsuhiro Tsujikawa2011-10-211-1/+1
| | | | | Now preference key is Pref instead of just string. It has Option ID. Now option lookup and setting takes O(1) using Pref object.
* Removed redundant call of util::isNumericHost().Tatsuhiro Tsujikawa2011-10-191-7/+4
|
* wallclock is now retrieved using global::wallclock() call.Tatsuhiro Tsujikawa2011-08-101-7/+7
| | | | | This is necessary to avoid global variable initialization order problem.
* Don't search faster server using ServerStatMan if req_ is null orTatsuhiro Tsujikawa2011-06-291-2/+3
| | | | total length is unknown.
* Use ServerStat to find faster server.Tatsuhiro Tsujikawa2011-06-281-12/+37
|
* Add CreateRequestCommand with STATUS_INACTIVE instead of SleepCommandTatsuhiro Tsujikawa2011-05-161-7/+8
| | | | | | | | | + DownloadFailureException. Throwing DownloadFailureException may stop download unexpectedly when --reuse-uri is false. Using CreateRequestCommand with STATUS_INACTIVE, they can be executed next iteration with DownloadEngine::setRefreshInterval(0).
* Eliminated few seconds delay when downloads stop or pause.Tatsuhiro Tsujikawa2011-05-151-6/+16
| | | | | | | | | | | | | | | | The delay is caused because some Commands are only called in certain interval(called refreshInterval, default, 1000ms). In aria2 download stops when all Commands associated to it are stopped. Since some Commands are called in each 1000ms by default, as mentioned before, we have to wait for them. To fix this issue, we call DownloadEngine::setRefreshInterval(0) when pausing/stopping downloads. DownloadEngine::setRefreshInterval(0) makes refreshInterval 0 in one shot. When all segments are ignored, now DownloadFailureException is thrown. And stop the download immediately. As described earlier, we call DownloadEngine::setRefreshInterval(0) in catch block of DownloadFailureException to eliminate delay.
* Check the availability of ares_set_servers and ares_addr_node.Tatsuhiro Tsujikawa2011-02-181-1/+6
|