summaryrefslogtreecommitdiff
path: root/src/AbstractCommand.cc
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* Added --async-dns-server option.Tatsuhiro Tsujikawa2011-02-081-1/+2
| | | | | | | | | | This option accepts comma separated list of DNS server address used in asynchronous DNS resolver. Usually asynchronous DNS resolver reads DNS server addresses from /etc/resolv.conf. When this option is used, it uses DNS servers specified in this option instead of ones in /etc/resolv.conf. You can specify both IPv4 and IPv6 address. This option is useful when the system does not have /etc/resolv.conf and user does not have the permission to create it.
* Don't call DownloadEngine::markBadIPAddress() when DNS query was timeout.Tatsuhiro Tsujikawa2011-02-081-7/+11
|
* Added --retry-wait option.Tatsuhiro Tsujikawa2011-01-171-0/+3
| | | | | | | | This option was once existed in aria2 but erased on 2009-09-20. Now it is resurrected once again. We choose 2 as default value, but there is no good theory behind it. Now we retry HTTP download when remote server returns 503 Service Unavailable if --retry-wait > 0. We also added error code 29: HTTP_SERVICE_UNAVAILABLE.
* Handle the situation when remote server returns Connection: closeTatsuhiro Tsujikawa2011-01-161-0/+6
| | | | | | | | after several pipelined requests. We call Request::setMaxPipelinedRequest(1) if Connection: close is received. Also call Request::supportsPersistentConnection(true) and Request::setMaxPipelinedRequest(1) when closing the connection.
* Eliminated SocketCore::peekData() form HTTP/FTP downloads.Tatsuhiro Tsujikawa2011-01-161-15/+29
| | | | | | | | | | We introduced SocketRecvBuffer which buffers received bytes. Since HTTP response header and response body are divided with \r\n, we have to buffer up several bytes to find this delimiter. We use SocketRecvBuffer to hold these bytes and only consumes header and passes SocketRecvBuffer, which may contain head of response body, to next Command. Since FTPConnection doesn't use SocketCore::peekData(), we left it as is.
* Added more error code values.Tatsuhiro Tsujikawa2010-12-011-4/+6
| | | | | I have not set error code for all exception invocation. In this change, I set error code where error likely occurs.
* Moved setLastError call before if(req_) {...Tatsuhiro Tsujikawa2010-11-291-1/+1
|
* Moved errorCode_ from RecoverableException to Exception and added errorCode toTatsuhiro Tsujikawa2010-11-281-8/+8
| | | | | | stackTrace. Also changed errno to errNum in stackTrace.
* Replaced RequestGroup::lastUriResult_ withTatsuhiro Tsujikawa2010-11-281-3/+3
| | | | RequestGroup::lastErrorCode_.
* Renamed DownloadErrorCode.h as error_code.h. RenamedTatsuhiro Tsujikawa2010-11-281-4/+4
| | | | downloaderrorcode::Value as error_code::Value.
* 2010-11-20 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-11-201-39/+39
| | | | | | | | Use format specifier %lld for cuid_t. Defined cuid_t as long long int instead of int64_t, since g++ complains int64_t is not suitable for %lld.
* 2010-11-20 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-11-201-7/+5
| | | | | | Replaced StringFormat with fmt
* 2010-11-20 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-11-201-124/+80
| | | | | | | Rewritten Logger interface. Logger now writes source file name and line number in log file.
* 2010-11-14 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-11-141-5/+34
| | | | | | | | | Added .cc file for classes/structs that only provided by header file. Defined non-POD classes' ctor, dtor in .cc file. Moved implementation code in header file to .cc file for major classes/strucsts.
* 2010-11-12 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-11-121-24/+24
| | | | | | | | Removed SharedHandle::isNull(). Instead we added operator* and operator unspecified_bool_type. Removed use of WeakHandle and replaced with raw pointer.
* 2010-11-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-11-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To match the behavior of friend operator functions in SharedHandle.h to std::tr1::shared_ptr, we intentionally broke these functions and modified code so that our code does not depend on old behavior. * src/AbstractCommand.cc * src/DHTAbstractNodeLookupTask.h * src/DHTBucket.cc * src/DHTMessageReceiver.cc * src/DHTNodeLookupEntry.cc * src/DHTRoutingTable.cc * src/DefaultBtRequestFactory.cc * src/DefaultPeerStorage.cc * src/DefaultPieceStorage.cc * src/DownloadContext.cc * src/EpollEventPoll.cc * src/Event.h * src/HttpConnection.cc * src/KqueueEventPoll.cc * src/MultiDiskAdaptor.cc * src/PeerAbstractCommand.cc * src/PieceStatMan.cc * src/PollEventPoll.cc * src/PortEventPoll.cc * src/SegmentMan.cc * src/SelectEventPoll.cc * src/SelectEventPoll.h * src/ServerStatMan.cc * src/SharedHandle.h * src/UnknownLengthPieceStorage.cc * src/a2functional.h * src/option_processing.cc * src/version_usage.cc * test/BNodeTest.cc * test/DHTAnnouncePeerMessageTest.cc * test/DHTBucketTest.cc * test/DHTFindNodeMessageTest.cc * test/DHTGetPeersMessageTest.cc * test/DHTIDCloserTest.cc * test/DHTMessageFactoryImplTest.cc * test/DHTPingMessageTest.cc * test/DefaultBtRequestFactoryTest.cc * test/DefaultPeerStorageTest.cc * test/SequentialPickerTest.cc * test/SingletonHolderTest.cc
* 2010-10-30 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-10-301-5/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use unnamed namespace instead of static keyword. * src/AbstractCommand.cc * src/AdaptiveURISelector.cc * src/Base64.cc * src/BitfieldMan.cc * src/BtDependency.cc * src/ConsoleStatCalc.cc * src/ContentTypeRequestGroupCriteria.cc * src/CookieStorage.cc * src/DHTMessageFactoryImpl.cc * src/DHTRoutingTableDeserializer.cc * src/DefaultBtAnnounce.cc * src/DefaultBtProgressInfoFile.cc * src/DefaultPeerStorage.cc * src/DefaultPieceStorage.cc * src/DownloadCommand.cc * src/DownloadEngine.cc * src/EpollEventPoll.cc * src/ExpatMetalinkProcessor.cc * src/ExpatXmlRpcRequestProcessor.cc * src/FileEntry.cc * src/HttpRequest.cc * src/HttpRequestCommand.cc * src/HttpResponseCommand.cc * src/KqueueEventPoll.cc * src/LongestSequencePieceSelector.cc * src/MetalinkParserStateV3Impl.cc * src/MetalinkParserStateV4Impl.cc * src/MultiDiskAdaptor.cc * src/MultiUrlRequestInfo.cc * src/OptionParser.cc * src/PeerSessionResource.cc * src/PortEventPoll.cc * src/Request.cc * src/RequestGroupMan.cc * src/SelectEventPoll.cc * src/SessionSerializer.cc * src/SimpleLogFormatter.cc * src/Sqlite3CookieParser.cc * src/TrackerWatcherCommand.cc * src/XML2SAXMetalinkProcessor.cc * src/Xml2XmlRpcRequestProcessor.cc * src/XmlRpcMethod.cc * src/XmlRpcMethodImpl.cc * src/XmlRpcResponse.cc * src/base32.cc * src/bencode2.cc * src/bittorrent_helper.cc * src/download_helper.cc * src/main.cc * src/messageDigest.cc * src/option_processing.cc * src/util.cc * test/AnnounceListTest.cc * test/BtRegistryTest.cc * test/DHTBucketTest.cc * test/DHTRoutingTableTest.cc * test/DefaultBtAnnounceTest.cc * test/FileEntryTest.cc * test/FtpConnectionTest.cc * test/MSEHandshakeTest.cc * test/MagnetTest.cc * test/XmlRpcMethodTest.cc * test/array_funTest.cc
* 2010-10-30 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-10-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added '// namespace' after end of unnamed namespace. * src/AbstractCommand.cc * src/AnnounceList.cc * src/BtSeederStateChoke.cc * src/ConsoleStatCalc.cc * src/CookieStorage.cc * src/DHTBucket.cc * src/DHTPeerAnnounceEntry.cc * src/DHTPeerAnnounceStorage.cc * src/DHTTaskQueueImpl.cc * src/DefaultBtMessageDispatcher.cc * src/DefaultBtRequestFactory.cc * src/DefaultPeerStorage.cc * src/DefaultPieceStorage.cc * src/ExpatMetalinkProcessor.cc * src/ExpatXmlRpcRequestProcessor.cc * src/FeedbackURISelector.cc * src/FileEntry.cc * src/GZipEncoder.cc * src/Metalink2RequestGroup.cc * src/MetalinkEntry.cc * src/MetalinkParserStateV3Impl.cc * src/MetalinkParserStateV4Impl.cc * src/Metalinker.cc * src/MultiDiskAdaptor.cc * src/Netrc.cc * src/NsCookieParser.cc * src/OptionParser.cc * src/PieceStatMan.cc * src/RarestPieceSelector.cc * src/RequestGroupMan.cc * src/SegmentMan.cc * src/ServerStatMan.cc * src/SocketCore.cc * src/XML2SAXMetalinkProcessor.cc * src/Xml2XmlRpcRequestProcessor.cc * src/XmlRpcMethodImpl.cc * src/cookie_helper.cc * src/download_helper.cc * src/messageDigest.cc * src/util.cc
* 2010-09-15 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-09-151-3/+0
| | | | | | | | | Don't set error in ServerStat just because resource is not there. We can still use the server for other resources. * src/AbstractCommand.cc
* 2010-09-15 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-09-151-21/+2
| | | | | | | | | | | | | | | | | | | | | | Fixed the bug that a file gets overwritten if -V is given and no hash is provided. Fixed the bug that --dry-run leads download error. Added RequestGroup::createCheckIntegrityEntry() which correctly creates CheckIntegrityEntry objects and open files based on -V option and the existence of control file. * src/AbstractCommand.cc * src/AbstractCommand.h * src/ChecksumCheckIntegrityEntry.cc * src/DownloadContext.cc * src/DownloadContext.h * src/FtpNegotiationCommand.cc * src/HttpResponseCommand.cc * src/PieceHashCheckIntegrityEntry.cc * src/RequestGroup.cc * src/RequestGroup.h * src/RequestGroupEntry.cc * src/RequestGroupEntry.h
* 2010-09-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-09-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | Replaced V_TRUE with A2_V_TRUE. Replaced V_FALSE with A2_V_FALSE. * src/AbstractCommand.cc * src/HttpResponseCommand.cc * src/Option.cc * src/OptionHandlerFactory.cc * src/OptionHandlerImpl.h * src/TrackerWatcherCommand.cc * src/download_helper.cc * src/main.cc * src/prefs.cc * src/prefs.h * test/AuthConfigFactoryTest.cc * test/DefaultBtProgressInfoFileTest.cc * test/DownloadHelperTest.cc * test/HttpRequestTest.cc * test/OptionHandlerTest.cc * test/UTMetadataPostDownloadHandlerTest.cc * test/XmlRpcMethodTest.cc