Commit Graph

994 Commits (f4469b79aae12b16f85b556001cb077f249e8b02)

Author SHA1 Message Date
Tatsuhiro Tsujikawa 910e40f128 Fix missing value in serialized pause option 2013-03-03 13:17:49 +09:00
Nils Maier f2f8b14047 Support for gzipped -i and --save-session
Saved sessions may very large, as in hundreds and even thousands of
megabyte when dealing with large queues.
Add support to save and reload sessions to gzipped files, when libz is
available.

The session serializer will output gzipped contents when the file ends
with .gz, while the input file reader (UriListParser) will accept
whatever is thrown at it.
2013-03-02 15:48:26 +01: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 d68741697a Support UDP tracker
It shares UDP listening port with IPv4 DHT. At the moment, in order to
enable UDP tracker support, enable IPv4 DHT.
2013-02-25 00:56:49 +09:00
Tatsuhiro Tsujikawa 67fa274578 Add test when instance-length is 0 2013-02-21 00:42:37 +09:00
Tatsuhiro Tsujikawa 45a128a7e8 Add test for saving finished download with force-save option 2013-02-04 21:56:48 +09:00
Tatsuhiro Tsujikawa 3fc45edaa7 Fix bug that active downloads are not saved with --save-session-interval 2013-02-04 21:50:09 +09:00
Tatsuhiro Tsujikawa 1c9cfccac4 Fix invalid iterator handling when deleting RequestGroup 2013-02-03 18:18:28 +09:00
Tatsuhiro Tsujikawa 13975f66a2 test: Add missing filelist2.txt to EXTRA_DIST 2013-02-02 21:22:18 +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 3a19b65dd7 Rename /BadCondition/ in Peer to /Drop/ 2013-01-26 18:50:48 +09:00
Tatsuhiro Tsujikawa 1e4f301ec1 Remove PeerStorage::getActivePeers() and add getUsedPeers() instead
PeerStorage::getUsedPeers() returns non-active peers, so caller must
call Peer::isActive() to get active peers.
2013-01-26 18:36:09 +09:00
Tatsuhiro Tsujikawa ba69f5c0c3 Refactor peer list management in DefaultPeerStorage
Peer list is now divided into 2: unusedPeers_ and usedPeers_.
Duplicate check is done using std::set by comparing pair of IP address
and port. For this, only IP address and port given to the Peer
constructor are used. In other words, TCP port received from extended
message is not used for this purpose.
2013-01-26 17:50:06 +09:00
Tatsuhiro Tsujikawa 88580da587 Remove Append and StringAppend 2013-01-15 21:46:03 +09:00
Tatsuhiro Tsujikawa 6a976a4118 Accept k and m as well as K and M in util::getRealSize() 2013-01-15 21:36:25 +09:00
Tatsuhiro Tsujikawa 2e216a9403 Fix unit test error 2013-01-14 21:34:33 +09:00
Tatsuhiro Tsujikawa c893d82867 Removed BtMessage::isSendingProgress()
DefaultBtMessageDispatcher::isSendingInProgress() now checks the
number of buffer entry in PeerConnection.
2013-01-11 20:26:31 +09:00
Tatsuhiro Tsujikawa 8ba0d58ee1 Vectorized write for SocketBuffer to avoid small packet 2013-01-11 16:50:04 +09:00
Tatsuhiro Tsujikawa 87af7c32c6 Use request URI as referer if --referer="*" is given 2013-01-08 21:42:42 +09:00
Tatsuhiro Tsujikawa 247084f9c3 Fixed bug that USR_BASENAME is not defined
In some cases, if the dirname is only "/", the basename will not be
defined (e.g., "/f"). This change fixes this bug.
2012-12-27 00:03:37 +09:00
Tatsuhiro Tsujikawa 616cd9e75f Simplified RequestGroupMan::fillRequestGroupFromReserver 2012-12-22 23:37:44 +09:00
Tatsuhiro Tsujikawa b017e80438 Changed threshold of using upper unit for abbrevSize 2012-12-19 23:58:24 +09:00
Tatsuhiro Tsujikawa 07bb779eb0 Faster deletion of RequestGroup and DownloadResult lists 2012-12-19 23:03:48 +09:00
Tatsuhiro Tsujikawa 77a4ee4de0 Save gid option with --save-session option 2012-12-17 00:33:11 +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 04586f50b1 Fixed BitfieldMan::getOffsetCompletedLength overflow on 32-bit systems 2012-12-16 17:26:01 +09:00
Tatsuhiro Tsujikawa de1ca6d6b8 mingw32: Use HANDLE only for MinGW32 build 2012-12-15 18:28:46 +09:00
Tatsuhiro Tsujikawa 4fdd5da27d Compact readout when more than 1 simultaneous downloads are going on
If more than 1 simultaneous downloads are going on, use more compact
format in readout. Currently, at most 5 download stats are displayed.

util::abbrevSize() is rewritten to support "Gi" unit and provides more
compact abbreviation.
2012-12-11 23:40:06 +09:00
Tatsuhiro Tsujikawa df5f1fe77f Fixed bug that size_ is not updated when WrDiskCacheEntry::append is called 2012-12-06 03:04:05 +09:00
Tatsuhiro Tsujikawa 838949ab85 Append new data to the contagious cache data
If we receive small data (e.g., 1 or 2 bytes), cache entry becomes a
headache. To mitigate this problem, we allocate cache buffer at least
4KiB and append the data to the contagious cache data.
2012-12-06 02:23:32 +09:00
Tatsuhiro Tsujikawa 56c498bcbf Clear write cache on Segment::clear and Piece::clearAllBlock 2012-12-06 00:39:14 +09:00
Tatsuhiro Tsujikawa 9ed8502e74 Write data in 4K aligned offset in write with disk cache enabled
This greatly reduces disk activity especially on Win + NTFS.  Not so
much difference on Linux.
2012-12-06 00:17:11 +09:00
Tatsuhiro Tsujikawa 8f2a4cc716 Removed unused members 2012-12-03 21:32:09 +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 e781e6eac1 Made socket non-blocking mode in SocketCore::beginListen() 2012-11-28 00:15:03 +09:00
Tatsuhiro Tsujikawa 438f95abae Made socket non-blocking mode in SocketCore::acceptConnection() 2012-11-28 00:10:32 +09:00
Tatsuhiro Tsujikawa 31189b1222 Made return type of util::parse_content_disposition ssize_t 2012-11-01 22:54:32 +09:00
Tatsuhiro Tsujikawa 118aed9c24 Content-Disposition parser conforming to RFC 6266.
RFC 2231 Continuation is not supported.
2012-10-27 14:51:07 +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 46bdaf0e8d Made HTTP/FTP download speed limiter more accurate
We have to do the same thing for BitTorrent.
2012-10-24 01:05:41 +09:00
Tatsuhiro Tsujikawa a9c76ed35e Added --rpc-save-upload-metadata option
If true is given, which is default, save the uploaded torrent or
metalink metadata in the directory specified by --dir option. The
filename consists of SHA1-hash hex string of metadata plus
extension. For torrent, the extension is '.torrent'. For metalink, it
is '.meta4'.  If false is given to this option, the downloads added by
aria2.addTorrent or aria2.addMetalink will not be saved by
--save-session option.
2012-10-16 00:18:34 +09:00
Tatsuhiro Tsujikawa 692f978978 Rewritten URI parser 2012-10-14 00:14:50 +09:00
Tatsuhiro Tsujikawa 8b0c701266 Removed trailing spaces 2012-10-01 23:52:22 +09:00
Tatsuhiro Tsujikawa e34d0e7ffa Dont' return SharedHandle from HttpHeader::getRange() 2012-09-30 17:30:35 +09:00
Tatsuhiro Tsujikawa 4b94ede268 Return ExtensionMessage subclass create return raw pointer 2012-09-28 23:40:44 +09:00
Tatsuhiro Tsujikawa 3258614033 Removed *Handle typedef 2012-09-28 23:27:46 +09:00
Tatsuhiro Tsujikawa 215d1d3d0b Made static create function of BtMessage subclass return raw pointer 2012-09-27 23:40:25 +09:00
Tatsuhiro Tsujikawa ae2e4cb7ff Handle OptionHandlers as raw pointer 2012-09-27 22:45:31 +09:00