Commit Graph

2490 Commits (847ebd54bcc610e8c83e713a39e9a8527240515f)

Author SHA1 Message Date
Tatsuhiro Tsujikawa 3637291c22 Fixed compile warning/error with mingw32 2011-12-10 19:06:09 +09:00
Tatsuhiro Tsujikawa ebc082747c Log filename in the exception when AbstractDiskWriter::closeFile() failed. 2011-12-10 18:03:30 +09:00
Tatsuhiro Tsujikawa 413b61c316 FTP PASV: fixed IPv6 support.
If fake FTP URI cannot be parsed (this should not happen), throw
exception.
2011-12-10 17:57:31 +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 9a6f88c162 Use util::itos() for signed integrals 2011-12-09 21:40:22 +09:00
Tatsuhiro Tsujikawa 31163c6785 Check totalLength of file is less than std::numeric_limits<off_t>::max()
If totalLength is larger than std::numeric_limits<off_t>::max(), throw
DownloadFailureException.
2011-12-09 21:39:43 +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 30e0e19e67 Code cleanup 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 b97a7c8ecf Use int32_t for begin, length in RangeBtMessage 2011-12-09 21:39:43 +09:00
Tatsuhiro Tsujikawa 9d15d732ed Use int32_t for piece length instead of size_t 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 f25e67b017 FTP pasv: Use request host when connecting server with http proxy. 2011-12-09 21:37:54 +09:00
Tatsuhiro Tsujikawa 2eed1c3914 Fixed bug which causes segmentation fault when bad piece is got. 2011-12-09 21:34:18 +09:00
Tatsuhiro Tsujikawa 9752704614 Cast size_t to unsigned long for %lu 2011-12-06 23:53:43 +09:00
Tatsuhiro Tsujikawa 1ff1505916 Fixed typo and code cleanup 2011-12-03 21:41:07 +09:00
Tatsuhiro Tsujikawa 53fd815111 Use binary search in BtDependency for efficiency. 2011-12-03 18:34:07 +09:00
Tatsuhiro Tsujikawa d1bb828066 Ignore peer which possibly sent bad data in next few minuts.
In aria2, one piece is downloaded from several peers, so when hash
check failed for that piece, it cannot determine which peer(s) sent
bad data. So, we ignore peer who sent last block of data in random
minutes. We use randomized timeout because all peers get waken up at
the almost same time.
2011-12-03 18:12:31 +09:00
Tatsuhiro Tsujikawa 6bf696ca11 New help messages. Added suggestion for unknown/ambiguous options.
The help messages shown when argument error were redesigned and less
verbose now.  When unknown or ambiguous option is given, show
suggestions like "Did you mean...". Some constant values related to
levenstein distance are borrowed from git help.c.
2011-12-03 16:30:00 +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
Tatsuhiro Tsujikawa f860bf0d50 Use %lld to fomat a2_gid_t 2011-12-02 21:36:11 +09:00
Tatsuhiro Tsujikawa bc9fb7cb65 Fixed bug in util::parseULLIntNoThrow() 2011-12-02 00:44:33 +09:00
Tatsuhiro Tsujikawa 11c5a13534 Return true if bits == 0 in util::inSameCidrBlock() 2011-12-02 00:27:14 +09:00
Tatsuhiro Tsujikawa 031f1199d7 Added const to Option::getTable() 2011-12-01 23:36:17 +09:00
Tatsuhiro Tsujikawa f9dd59eebd Added missing XmlParser::parseMemory() in ExpatXmlParser.cc 2011-12-01 23:34:14 +09:00
Tatsuhiro Tsujikawa 82e5318e35 Fixed compile error with mingw 2011-12-01 23:21:56 +09:00
Tatsuhiro Tsujikawa b89bc8a6cb Added --stop-with-process=PID option.
This feature stops application when process PID is not running.  This
is useful if aria2 process is forked from a parent process. The parent
process can fork aria2 with its own pid and when parent process exits
for some reason, aria2 can detect it and shutdown itself.

The code which detects whether or not given process PID is running is
contributed by Emmanuel Engelhart.
2011-12-01 23:21:44 +09:00
Tatsuhiro Tsujikawa 27dda3c65c Support IPv6 address for FTP via HTTP tunneling.
We use control connection address as data connection address, so we
don't need to store both address and port. We just store port in
PASV/EPSV response and use SocketCore::getPeerInfo() to get peer's
address when needed.
2011-11-14 23:19:37 +09:00
Tatsuhiro Tsujikawa 97a9242cbe Proxy URI is now constructed in getProxyUri().
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.
2011-11-13 23:06:24 +09:00
Tatsuhiro Tsujikawa c42dd7e755 Changed format of ETA.
Now no leading 0 is used. If hour part and/or min part is non-zero,
and sec part is 0, sec part is omitted, like this "1h3m".
2011-11-13 20:59:15 +09:00
Tatsuhiro Tsujikawa 1687741303 Use fmt instead of util::itos 2011-11-13 20:55:06 +09:00
Tatsuhiro Tsujikawa 9e5124eb11 Include trailing "/" in UriStruct::dir.
The duplicate "/"s in dir are not removed now.
2011-11-12 22:36:05 +09:00
Tatsuhiro Tsujikawa c0dda6a0f7 Changed createSockPoolKey so that we can support IPv6 numeric address safely. 2011-11-12 21:31:14 +09:00
Tatsuhiro Tsujikawa db5cc4db27 Don't append character to std::string. 2011-11-12 21:27:24 +09:00
Tatsuhiro Tsujikawa 5347efb967 Use fmt instead of using snprintf directly 2011-11-12 19:33:38 +09:00
Tatsuhiro Tsujikawa 0da2468d6b Removed strappend 2011-11-12 19:24:38 +09:00
Tatsuhiro Tsujikawa 2e5d9b056f Removed strconcat 2011-11-12 18:17:34 +09:00
Tatsuhiro Tsujikawa c4e66390ac Code cleanup 2011-11-12 17:13:43 +09:00
Tatsuhiro Tsujikawa f1f1b991f1 Removed SocketBuffer::pushStrSwap. 2011-11-12 01:19:01 +09:00
Tatsuhiro Tsujikawa f0f1cfab5c Use util::strifind instead of std::toLower and std::string::find. 2011-11-12 01:13:55 +09:00
Tatsuhiro Tsujikawa 2f4393d17c Rewritten parse*Int 2011-11-12 01:06:52 +09:00
Tatsuhiro Tsujikawa 226480ad60 Made const char[] static 2011-11-11 23:00:41 +09:00
Tatsuhiro Tsujikawa d17ea2837b HttpHeader::fill() now stores header name in lowercase.
Find methods in HttpHeader won't lowercase argument, so use lowercase
letters to get HTTP header field.
2011-11-11 22:50:18 +09:00
Tatsuhiro Tsujikawa 35a3f41346 Made Pref::k_, OptionHandler::getName() and getDescription() const char*. 2011-11-11 01:59:23 +09:00
Tatsuhiro Tsujikawa 787bfd75da Use XmlParser for XML-RPC. 2011-11-11 00:37:32 +09:00
Tatsuhiro Tsujikawa 3b4a368554 Rewritten Expat Metalink XML parser. 2011-11-10 23:28:12 +09:00
Tatsuhiro Tsujikawa 440f29aca3 Rewritten Metalink XML parser.
Now we don't strip white spaces while parsing Metalink V3 document.
Expat implementation does not included in this change.
2011-11-10 22:38:01 +09:00
Tatsuhiro Tsujikawa f114a6fba4 Now xml attribute and characters in RPC request is not stripped at all.
Changed XmlRpcRequestParserState so that name is now const char*.
2011-11-09 00:21:02 +09:00
Tatsuhiro Tsujikawa bdaa87c73b Avoid temporary string 2011-11-08 23:53:12 +09:00
Tatsuhiro Tsujikawa 7f8724c501 Removed temporary string 2011-11-08 23:45:40 +09:00
Tatsuhiro Tsujikawa 6ed36b73c1 Code cleanup 2011-11-08 23:27:23 +09:00
Tatsuhiro Tsujikawa aa6f9c2057 Removed unused code 2011-11-08 23:13:47 +09:00
Tatsuhiro Tsujikawa 2ca98cc428 Use std::search instead of creating temporary std::string. 2011-11-08 00:59:49 +09:00
Tatsuhiro Tsujikawa 72a1847ba8 Rewritten *ARC4Encryptor. Removed *ARC4Context.
Now *ARC4Encryptor supports in-place encryption.
2011-11-08 00:50:07 +09:00
Tatsuhiro Tsujikawa f6f053cae1 Fixed out of array bound 2011-11-08 00:15:37 +09:00
Tatsuhiro Tsujikawa 02b3873e6d Removed ARC4Decryptor because ARC4Encryptor can decrypt the message. 2011-11-07 22:24:47 +09:00
Tatsuhiro Tsujikawa 30fdb08f40 Rewritten parametered URI handling routine. 2011-11-06 16:37:02 +09:00
Tatsuhiro Tsujikawa d45d854926 Rewritten base64::decode and base64::encode 2011-11-05 23:30:46 +09:00
Tatsuhiro Tsujikawa 17a1b51a76 mv Base64.{cc,h} base64.{cc,h} 2011-11-05 21:13:49 +09:00
Tatsuhiro Tsujikawa 0c162dfbfb Made util::fromHex and base32::decode function template 2011-11-05 18:05:23 +09:00
Tatsuhiro Tsujikawa 6ea1b68db1 Added SocketBuffer::pushStrSwap 2011-11-05 17:28:48 +09:00
Tatsuhiro Tsujikawa 4dad3ded15 Use SocketBuffer::pushBytes instead of pushStr in MSEHandshake. 2011-11-05 17:03:38 +09:00
Tatsuhiro Tsujikawa 5e2a8b2d4c Fixed bug that some information such as port number is lost if
redirect URI contains only path component.
2011-11-05 13:16:45 +09:00
Tatsuhiro Tsujikawa 0b515d7204 Use uri::UriStruct in Request.h 2011-11-05 13:00:40 +09:00
Tatsuhiro Tsujikawa 7d68c40a77 Made decoderawstring return pair of iterators, not string. 2011-11-05 12:15:34 +09:00
Tatsuhiro Tsujikawa d1d4903665 Rewritten bencode2::decode functions 2011-11-05 12:01:57 +09:00
Tatsuhiro Tsujikawa d305432ec0 Code cleanup. Avoid std::string temporaries. 2011-11-05 01:26:09 +09:00
Tatsuhiro Tsujikawa 1d56c17225 Code cleanup. Avoid std::string temporaries. 2011-11-05 01:11:04 +09:00
Tatsuhiro Tsujikawa 150c1ab0c3 Code cleanup 2011-11-05 00:45:09 +09:00
Tatsuhiro Tsujikawa 5c88f61269 Added util::istartsWith() 2011-11-05 00:33:35 +09:00
Tatsuhiro Tsujikawa 79876af88f Removed util::endsWith(a, b). Added util::iendsWith() 2011-11-05 00:25:24 +09:00
Tatsuhiro Tsujikawa 601ec0f44a Removed util::startsWith(a, b) 2011-11-04 23:43:32 +09:00
Tatsuhiro Tsujikawa f84d2253b2 Rewritten util::split and added its iterator version.
Iterator based functions util::startsWith, util::endsWith,
util::streq, util::strieq were added.
2011-11-04 22:27:58 +09:00
Tatsuhiro Tsujikawa 6267676e8b util::divide now takes iterators as arguments. 2011-11-03 23:09:03 +09:00
Tatsuhiro Tsujikawa 118626afc4 util::percentDecode now takes iterators as arguments. 2011-11-03 19:27:29 +09:00
Tatsuhiro Tsujikawa 0e55fdf594 Code cleanup 2011-11-03 18:59:56 +09:00
Tatsuhiro Tsujikawa 84bc2c7ae8 Use std::string::append instead of appending std::string() temporaries. 2011-11-03 18:56:47 +09:00
Tatsuhiro Tsujikawa 9bb914b76e Changed parse*Int functions so that it accepts iterators. 2011-11-03 18:51:31 +09:00
Tatsuhiro Tsujikawa 6ef91d60b3 Rewritten util::stripIter(), which now returns pair of iterator. 2011-11-03 16:19:21 +09:00
Tatsuhiro Tsujikawa e8d4deecad Rewritten HttpHeader::fill() 2011-11-03 00:31:27 +09:00
Tatsuhiro Tsujikawa d9833743d9 Use merged option values. 2011-11-02 00:32:58 +09:00
Tatsuhiro Tsujikawa 1a418b518c --index-out option is now available in aria2.changeOption.
--index-out option is now available in aria2.changeOption if a
download is waiting/paused in queue.
2011-11-02 00:27:31 +09:00
Tatsuhiro Tsujikawa f884ad8339 Rewritten parseIndexPath. Renamed createIndexPathMap as createIndexPaths. 2011-11-02 00:18:39 +09:00
Tatsuhiro Tsujikawa 701a2d6ff8 --dir and --out option is now available in aria2.changeOption.
--dir and --out option is now available in aria2.changeOption if a
download is waiting/paused in queue.
2011-11-02 00:01:25 +09:00
Tatsuhiro Tsujikawa 9a51cc356b Changed interface of BtRegistry.
BtRegistry now uses SharedHandle<BtObject> instead of BtObject.
2011-11-01 23:13:13 +09:00
Tatsuhiro Tsujikawa a88a8b4ed1 Removed default value from deprecated --metalink-servers option. 2011-10-31 23:06:51 +09:00
Tatsuhiro Tsujikawa 22a3e44d36 SegList: Don't allow copying 2011-10-31 23:04:37 +09:00
Tatsuhiro Tsujikawa 57b37db8a1 --max-connection-per-server option is now available in aria2.changeOption.
--max-connection-per-server option is now available in
aria2.changeOption if a download is waiting/paused in queue.
2011-10-31 22:43:05 +09:00
Tatsuhiro Tsujikawa 9e2624a265 Apply PREF_MAX_CONNECTION_PER_SERVER to BitTorrent WEB Seeding hosts. 2011-10-31 22:05:56 +09:00
Tatsuhiro Tsujikawa e2e711fba8 Reuse in-flight and pooled URIs when a download is paused. 2011-10-31 21:53:24 +09:00
Tatsuhiro Tsujikawa 4532881eb6 Code cleanup 2011-10-30 22:39:29 +09:00
Tatsuhiro Tsujikawa 84b19f154a Deprecated --metalink-server option. Use --split option instead. 2011-10-30 21:36:36 +09:00
Tatsuhiro Tsujikawa fc7af71aa8 --split option is now available in aria2.changeOption.
--split option is now available in aria2.changeOption if a download is
waiting/paused in queue.
2011-10-30 19:23:27 +09:00
Tatsuhiro Tsujikawa 1d9e673a68 --select-file option is now available in aria2.changeOption
--select-file option is now available in aria2.changeOption if a
download is waiting/paused in queue.
2011-10-30 19:13:40 +09:00
Tatsuhiro Tsujikawa 4552bb8c21 Code cleanup 2011-10-30 15:11:22 +09:00
Tatsuhiro Tsujikawa 4a455b5afe Removed IntSequence and Sequence<T> 2011-10-30 15:08:44 +09:00
Tatsuhiro Tsujikawa 95586f594f Use SegList<int> instead of IntSequence in Metalink2RequestGroup. 2011-10-30 15:04:15 +09:00
Tatsuhiro Tsujikawa a6ea8531e7 Code cleanup 2011-10-30 14:42:19 +09:00
Tatsuhiro Tsujikawa 4be395117d Use SegList<int> instead of IntSequence. 2011-10-30 14:25:36 +09:00