Commit Graph

826 Commits (c2eb9d791a06baa4d28046813c25f4da137faa77)

Author SHA1 Message Date
Tatsuhiro Tsujikawa 7e7aeac3ff Added --piece-length option.
This option sets a piece length for HTTP/FTP downloads. This is the
boundary when aria2 splits a file. All splits occur at multiple of
this length. This option will be ignored in BitTorrent downloads.  It
will be also ignored if Metalink file contains piece hashes.
2011-09-27 21:48:41 +09:00
Tatsuhiro Tsujikawa 05104ba177 Removed asString, asList, ... and use downcast<T> instead. 2011-09-26 21:45:45 +09:00
Tatsuhiro Tsujikawa c408dbba72 Recognize tab as white space before option in -i list. 2011-08-28 00:40:23 +09:00
Tatsuhiro Tsujikawa a743bef220 Fixed output file path of tests. 2011-08-25 00:26:36 +09:00
Tatsuhiro Tsujikawa c7ac147287 Added PieceStorage::onDownloadIncomplete() virtual function.
In DefaultPieceStorage::onDownloadIncomplete(), we call
StreamPieceSelector::onBitfieldInit().
Added GeomStreamPieceSelectorTest.
2011-08-24 23:16:06 +09:00
Tatsuhiro Tsujikawa a081f651a1 GeomStreamPieceSelector: Made base changeable and added offsetIndex
parameter.
2011-08-24 21:56:55 +09:00
Tatsuhiro Tsujikawa 201af99501 Added GeomStreamPieceSelector. 2011-08-24 21:56:54 +09:00
Tatsuhiro Tsujikawa 0f72cbab8a JsonTest: Added test case for decoding escaped chars 2011-08-24 21:55:54 +09:00
Tatsuhiro Tsujikawa f7aeb86ccc Added --download-result option.
Added --download-result=OPT option.  This option changes the way
"Download Results" is formatted. If OPT is 'default', print GID,
status, average download speed and path/URI. If multiple files are
involved, path/URI of first requested file is printed and remaining
ones are omitted.  If OPT is 'full', print GID, status, average
download speed, percentage of progress and path/URI. The percentage of
progress and path/URI are printed for each requested file in each row.
2011-08-22 23:05:06 +09:00
Tatsuhiro Tsujikawa 3c73b6e767 Eliminated inet_ntoa and inet_ntop. Use getnameinfo() instead. 2011-08-20 21:53:48 +09:00
Tatsuhiro Tsujikawa 4c1c38a33f Ignore --out option supplied in command-line if -i is used.
You can still use out option in the text file specified in -i.
2011-08-18 18:36:17 +09:00
Tatsuhiro Tsujikawa dce0667c0b MinGW32 build: Replace all '\' in path with '/' in util::applyDir()
In MinGW32 build, replace all '\' in path with '/' in
util::applyDir().  Take into account '\' in File::getBasename() and
File::getDirname().
2011-08-18 17:27:41 +09:00
Tatsuhiro Tsujikawa 6ee913b0bc Simplified PieceStatMan and RarestPieceSelector.
Simplified PieceStatMan and RarestPieceSelector, but computation order
 to select piece index is still O(N) and unchanged.  Updating piece
 stat is improved to O(N) for bitfield update and O(1) for single
 index update, while old implementation needs O(NlogN) and O(N)
 respectively.
2011-08-10 21:29:01 +09:00
Tatsuhiro Tsujikawa e8e3a6f259 wallclock is now retrieved using global::wallclock() call.
This is necessary to avoid global variable initialization order
problem.
2011-08-10 01:17:28 +09:00
Tatsuhiro Tsujikawa 97f34ab668 Added global::cerr. windows.h now included from common.h
We replaced most of std::cerr with global::cerr.  windows.h is now
included from common.h. Before including it, we define WINVER.  We
renamed some variable name because some macros in windows.h collide
with them.
2011-08-10 00:38:48 +09:00
Tatsuhiro Tsujikawa a10cda2f17 Use global::cout to output string to stdout.
In MinGW32 build, global::cout is WinConsoleFile. When outputing to
console, it uses WriteConsoleW, so Unicode characters are written.
Fixed memory leak in WChar<->MultiByte conversion functions.  The
portion of code which uses std::cout is rewritten to use global::cout.
2011-08-09 23:33:55 +09:00
Tatsuhiro Tsujikawa 7368c9c9d8 Percent-encode non-printable ASCII and non-ASCII chars in FileEntry.
Percent-encode non-printable ASCII and non-ASCII chars in URI using
util::percentEncodeMini() when URI is added to FileEntry.  Removed
percent-encode from Request. Also do percent-encoding when setting
referer and redirected URI.
2011-08-07 20:46:04 +09:00
Tatsuhiro Tsujikawa a6c2ad53bf Rewritten UriListParser using BufferedFile 2011-08-07 01:05:02 +09:00
Tatsuhiro Tsujikawa 1f710d29c1 Rewritten SessionSerializer using BufferedFile 2011-08-07 00:36:44 +09:00
Tatsuhiro Tsujikawa 190d170076 Rewritten ServerStatMan using BufferedFile. 2011-08-07 00:10:53 +09:00
Tatsuhiro Tsujikawa 7f3d027b83 Removed feof from operator unspecified_bool_type. Added eof().
In BufferedFile, removed feof from operator unspecified_bool_type. EOF
can be queried separately using newly added eof().
2011-08-07 00:06:32 +09:00
Tatsuhiro Tsujikawa 6cb91cae88 Added fopen/fread/fwrite/fgets wrapper class. 2011-08-06 21:17:36 +09:00
Tatsuhiro Tsujikawa 168094560d Rewritten CookieStorage using stdio instead of stream 2011-08-05 22:44:54 +09:00
Tatsuhiro Tsujikawa dea7a7969c Rewritten DHTRoutingTableSerializer using stdio instead of stream. 2011-08-05 22:15:55 +09:00
Tatsuhiro Tsujikawa f141cd4228 Rewritten DHTRoutingTableDeserializer using stdio instead of stream. 2011-08-05 21:50:11 +09:00
Tatsuhiro Tsujikawa 3879da592d In MinGW32, open file with UNICODE filename and print them in ANSI. 2011-08-04 21:43:02 +09:00
Tatsuhiro Tsujikawa 70eeebfae9 Retry DHT get_peers task if the number of peers in PeerStorage is less
than max peers.

Added virtual size_t countPeer() const to PeerStorage.
2011-07-29 23:49:25 +09:00
Tatsuhiro Tsujikawa 4ea28cb837 Don't send basic auth header to service operated on differenct port.
When --http-auth-challenge=true, aria2 only sends basic auth header
when requested. Old implementation sends basic auth header to service
operated in different port in successive request. This change avoid
this bug.
2011-07-27 23:28:31 +09:00
Tatsuhiro Tsujikawa 02292feaba Consistent naming scheme for hash type and digest for Piece. 2011-07-27 22:50:10 +09:00
Tatsuhiro Tsujikawa 03f0774482 Consistent naming scheme for hash type and digest for DownloadContext. 2011-07-27 22:44:30 +09:00
Tatsuhiro Tsujikawa 7b86b294c9 Consistent naming scheme for hash type and digest. 2011-07-27 21:44:54 +09:00
Tatsuhiro Tsujikawa 67e91c3431 HttpResponse::getDigest() now returns all Digest.
In addition, HttpResponse::getMetalinkHttpEntries() does not check
validity of URI. It is checked when we add it to FileEntry.
2011-07-27 19:32:35 +09:00
Tatsuhiro Tsujikawa 7c317de4e7 Added Metalink/HTTP Link and Digest header field parser. 2011-07-26 23:41:21 +09:00
Tatsuhiro Tsujikawa c58f736bb9 BtRegistry now holds BitTorrent TCP server port.
Because BitTorrent TCP server port is global configuration, it is not
preferable that per download resource BtRuntime holds it.  We also
refactored and eliminated ugly static variable in PeerListenCommand.
If TCP port is necessary, we inject it to them directly.
2011-07-21 23:42:41 +09:00
Tatsuhiro Tsujikawa dbf4f553ca Deprecated --enable-direct-io option.
Modified DeprecatedOptionHandler so that it can have replacing
OptionHandler.
2011-07-16 16:03:28 +09:00
Tatsuhiro Tsujikawa 5c4a52ad74 Managed user cuid in Piece.
Previous implementation does not store information which Command cuid
uses which Piece.  Mark Piece acquired by SegmentMan by setting
Piece::setUsedBySegment(true).
2011-07-16 00:58:41 +09:00
Tatsuhiro Tsujikawa d1885a5874 Allowed missing params in system.multicall RPC method. 2011-06-15 00:42:50 +09:00
Tatsuhiro Tsujikawa 65ec9e98df Replaced InOrder with Inorder. 2011-06-11 21:49:09 +09:00
Tatsuhiro Tsujikawa deaea9537b Added --stream-piece-selector option.
This option specifies piece selection algorithm used in HTTP/FTP
download. Piece means fixed length segment which is downloaded in
parallel in segmented download. If 'default' is given, aria2 selects
piece so that it reduces the number of establishing connection. This
is reasonable default behaviour because establishing connection is an
expensive operation.  If 'inorder' is given, aria2 selects piece which
has minimum index. Index=0 means first of the file. This will be
useful to view movie while downloading it. --enable-http-pipelining
option may be useful to reduce reconnection overhead.  Please note
that aria2 honors --min-split-size option, so it will be necessary to
specify a reasonable value to --min-split-size option.
2011-06-11 21:41:56 +09:00
Tatsuhiro Tsujikawa 595a514b17 Fixed typo 2011-06-11 18:03:33 +09:00
Tatsuhiro Tsujikawa cc82da3bab Added StreamPieceSelector class.
This class abstracts the piece selection algorithm for HTTP/FTP
download.
2011-06-11 17:34:17 +09:00
Tatsuhiro Tsujikawa 2799c9f0cc Only percent-encode non-printable ASCII chars(0x00-0x1f), non-ASCII
chars(>0x7f), ' ', '"', '<' and '>' for URIs supplied by user and
remote server(usually Location header field).
2011-06-01 01:34:30 +09:00
Tatsuhiro Tsujikawa 4784114281 Don't save removed download in --save-session text file.
Now stat column of removed downloads in Download Results is 'RM'
instead of INPR.
2011-05-29 20:59:45 +09:00
Tatsuhiro Tsujikawa 0f9b59cdce Fixed compile error with g++-4.6.1 2011-05-21 00:04:25 +09:00
Tatsuhiro Tsujikawa 5cef1cb15c Added missing base_uri.xml to EXTRA_DIST 2011-05-16 23:28:33 +09:00
Tatsuhiro Tsujikawa 286991e17d Strip DQUOTE from cookie-value and updated doc. 2011-05-14 21:24:10 +09:00
Tatsuhiro Tsujikawa ad5af56c17 Support relative URI in Metalink file.
If relative URI is found in Metalink file, aria2 resolves its full URI
contatenating the URI from which Metalink file is retrieved and
relative URI in Metalink file. This feature is not available if
Metalink file in local disk is specified in command line.
2011-05-07 18:41:18 +09:00
Tatsuhiro Tsujikawa e7d7233d54 Moved joinUri from util namespace to uri namespace. 2011-05-06 23:20:43 +09:00
Tatsuhiro Tsujikawa 1122e55a35 Handle "..", "." in util::joinUri() 2011-04-30 22:42:10 +09:00
Tatsuhiro Tsujikawa 55d00d047c Added swap for UriStruct 2011-04-30 00:29:14 +09:00