Commit Graph

209 Commits (fa30fe4b15dc10d5ac278534da54e63951a099e7)

Author SHA1 Message Date
Nils Maier 8526ceeb45 Convert to autos and ranged loops 2013-08-21 05:56:17 +02:00
Nils Maier d8f44ef4f6 Convert most 0/NULL pointers to nullptr
Courtesy of llvm cpp11-migrate 3.3
2013-08-20 21:28:24 +02:00
Tatsuhiro Tsujikawa de55569de5 Always save control file if --force-save is given 2013-07-28 18:07:29 +09:00
Tatsuhiro Tsujikawa 41121e09f7 Use std::unique_ptr for Metalink objects 2013-07-12 23:09:23 +09:00
Tatsuhiro Tsujikawa a479473949 Use std::unique_ptr for URISelector instead of std::shared_ptr 2013-07-04 01:16:48 +09:00
Tatsuhiro Tsujikawa fa9f3fb5a3 Wrap Command object in std::unique_ptr 2013-06-23 21:55:52 +09:00
Tatsuhiro Tsujikawa bb5b7eeedb Move RequestGroup vector from Context to RequestGroupMan 2013-06-23 16:35:14 +09:00
Tatsuhiro Tsujikawa 286bb2840e Remove Triplet, use std::tuple instead 2013-06-22 21:08:50 +09:00
Tatsuhiro Tsujikawa e791eb9ca3 Cleanup a2functional.h
Remove mem_fun_sh in favor of std::mem_fun. Remove unused functions.

Use std::mem_fn instead of mem_fun_sh
2013-06-22 17:53:39 +09:00
Tatsuhiro Tsujikawa 07d270c87e Require -std=c++11 and use std::shared_ptr instead of SharedHandle 2013-06-22 01:10:38 +09:00
Tatsuhiro Tsujikawa cef6db17ba Add changePosition API 2013-05-15 00:50:55 +09:00
Tatsuhiro Tsujikawa 1c571f196a Refactor Notifier interface to accept DownloadEventListener interface
WebSocketSessionMan now implements DownloadEventListener and is added
to Notifier. It becomes member variable of DownloadEngine.  The event
constant for download event is defined in aria2.h so that we can add
event callback API later.
2013-05-11 18:50:03 +09:00
Tatsuhiro Tsujikawa 24a6896bf4 Add sessionConfigSetKeepRunning and shutdown API function
Setting sessionConfigSetKeepRunning to true makes aria2 core keep
running even if there is no download to perform, just like --enable-rpc
option.
2013-05-01 21:28:04 +09:00
Tatsuhiro Tsujikawa 90abec8a36 Move initialization code in aria2::main to struct Context 2013-04-25 21:46:31 +09:00
Tatsuhiro Tsujikawa baaa3a4fb2 Use IndexedList::remove_if to clean up RequestGroupMan::removeStoppedGroup 2013-03-03 18:08:19 +09:00
Tatsuhiro Tsujikawa d4ba562710 Implement IndexedList::iterator
It is dangerous to expose internal iterator to the outside, which is
easily misused.
2013-03-03 18:00:42 +09:00
Nils Maier 7f6a446750 Hygiene: Fix some clang warnings, mostly unused private members. 2013-03-01 13:17:52 +01:00
Tatsuhiro Tsujikawa a49397ed19 Fix infinite loop when size of downloadResults_ exceeds maxDownloadResult_ 2013-02-25 21:42:54 +09:00
Tatsuhiro Tsujikawa 1c9cfccac4 Fix invalid iterator handling when deleting RequestGroup 2013-02-03 18:18:28 +09:00
Tatsuhiro Tsujikawa 561f0b3e29 Use std::deque instead of std::list in IndexedList
We choose faster iteration over rare slower deletion in the middle.
2013-02-01 00:03:47 +09:00
Tatsuhiro Tsujikawa 616cd9e75f Simplified RequestGroupMan::fillRequestGroupFromReserver 2012-12-22 23:37:44 +09:00
Tatsuhiro Tsujikawa 07bb779eb0 Faster deletion of RequestGroup and DownloadResult lists 2012-12-19 23:03:48 +09:00
Tatsuhiro Tsujikawa 0a4ce4fdb5 Use map to make DownloadResult lookup fast 2012-12-16 18:50:45 +09:00
Tatsuhiro Tsujikawa b9da9d4ed3 Use 64 bits random bytes as GID
This change replaces the current 64 bit sequential GID with 64 bits
random bytes GID in an attempt to support persistent GID. Internally,
the GID is stored as uint64_t. For human representation and RPC
interface, GID is represented as 16 bytes hex string. For console
readout, 16 bytes are too long, so it is abbreviated to first 6 bytes.
When querying GID in RPC calls, user can speicfy the prefix of GID as
long as the prefix is shared by more than 1 GID entries.
2012-12-16 17:29:01 +09:00
Tatsuhiro Tsujikawa e86fd44dc5 Console color output
Log level and download result string is now colored.
2012-12-08 21:48:18 +09:00
Tatsuhiro Tsujikawa f314719618 Added --disk-cache option
This option enables disk cache. If SIZE is 0, the disk cache is
disabled. This feature caches the downloaded data in memory, which
grows to at most SIZE bytes. The cache storage is created for aria2
instance and shared by all downloads. The one advantage of the disk
cache is reduce the disk seek time because the data is written in
larger unit and it is reordered by the offset of the file. If the
underlying file is heavily fragmented it is not the case.
2012-12-03 01:39:10 +09:00
Tatsuhiro Tsujikawa 2cbdd8b845 Fixed compile error without BitTorrent support 2012-12-01 21:33:25 +09:00
Tatsuhiro Tsujikawa 0ecfa19925 Reworked download/upload statistics calculation
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.
2012-10-25 23:33:45 +09:00
Tatsuhiro Tsujikawa c904aa50fe Use uri_split instead of uri::parse where appropriate 2012-10-14 18:05:34 +09:00
Tatsuhiro Tsujikawa 3258614033 Removed *Handle typedef 2012-09-28 23:27:46 +09:00
Tatsuhiro Tsujikawa d8c44fe9e8 Use const char* instead of static const std::string 2012-09-24 23:20:43 +09:00
Tatsuhiro Tsujikawa e2340efe27 Use std::vector instead of std::map for ContextAttribute objects
Now key for ContextAttribute object store is int instead of string.
2012-09-22 17:37:30 +09:00
Tatsuhiro Tsujikawa 763c7a0aa0 Pause download even if download is completed
This allows to pause and unpause BitTorrent seed.
2012-09-07 01:40:40 +09:00
Tatsuhiro Tsujikawa 8f1049c15f Fixed assertion in removeRequestGroupIndex() 2012-08-03 00:27:03 +09:00
Tatsuhiro Tsujikawa 2795176d79 Add GID => RequestGroup index for faster access to RequestGroup 2012-07-31 23:55:51 +09:00
Tatsuhiro Tsujikawa 329a17b3f9 Removed tailing whitespaces 2012-07-31 21:26:59 +09:00
Tatsuhiro Tsujikawa 1b874268a0 Use int64_t instead of off_t
Some classes such as DiskAdaptor, DiskWriter, FileAllocationIterator
and ChecksumValidator are left unchanged.
2012-06-25 23:35:24 +09:00
Tatsuhiro Tsujikawa 4b03634f36 Use PRId64 for int64_t format specifier 2012-06-25 22:43:33 +09:00
Tatsuhiro Tsujikawa 7bc2a14d9f Fixed compile error without BitTorrent support 2012-04-08 00:05:42 +09:00
Tatsuhiro Tsujikawa 8499a47d21 Added --bt-remove-unselected-file option.
Removes the unselected files when download is completed in
BitTorrent. To selecting files, use --select-file option. If it is not
used, all files are assumed to be selected. Please use this option
with care because it will actually remove files from your disk.
This option is default to false.
2012-03-25 19:25:43 +09:00
Tatsuhiro Tsujikawa eed804baaa Use std::set instead of std::deque if the elements are sorted and
insertions and deletions are frequent.
2012-03-23 01:34:37 +09:00
Tatsuhiro Tsujikawa f4e2c7f060 Added JSON-RPC over WebSocket.
Wslay library must be placed under deps/wslay.
2012-03-20 21:42:09 +09:00
Tatsuhiro Tsujikawa f2d55f0edc Added --deferred-input option.
If true is given to --deferred-input option, aria2 does not read all
URIs and options from file specified by -i option at startup, but it
reads one by one when it needs later. This may reduce memory usage if
input file contains a lot of URIs to download. If false is given,
aria2 reads all URIs and options at startup. This option defaults to
false.
2012-02-05 18:57:16 +09:00
Tatsuhiro Tsujikawa 52155b1860 No retry for close() with EINTR. Also reverted changes in d5ffa253. 2011-12-25 23:38:36 +09:00
Tatsuhiro Tsujikawa d5ffa2532d AbstractDiskWriter::closeFile(): Throw exception if close() failed.
~AbstractDiskWriter calles closeFile(), but suppresses exception.
MultiDiskAdaptor::closeFile() logs error if child
DiskWriter::closeFile() throws exception. This exception is not
rethrown. If at least one exception is caught,
MultiDiskAdaptor::closeFile() throws new DlAbortEx.
RequestGroupMan::closeFile() just logs exception and suppress each
exception. Generally, don't call closeFile() in destructor. If you
need to call it, it must suppress the exception.
2011-12-09 23:32:38 +09:00
Tatsuhiro Tsujikawa 7989cd898d Use int or int32_t instead of size_t where suitable 2011-12-09 21:39:43 +09:00
Tatsuhiro Tsujikawa f0bcfa822e Use int instead of unsigned int where unsigned int is not needed. 2011-12-09 21:39:43 +09:00
Tatsuhiro Tsujikawa 12988e5282 Replaced uint64_t with off_t or int64_t.
Since off_t is int64_t with LFS, we cannot take advantage of extra
capacity of uint64_t.
2011-12-09 21:39:43 +09:00
Tatsuhiro Tsujikawa 26d4ca8a6a Made notice level log messages translatable 2011-12-02 22:38:53 +09:00
Tatsuhiro Tsujikawa dd3f688743 Made some texts translatable 2011-12-02 22:00:48 +09:00