Commit Graph

2908 Commits (126a4bde612eb0e6c48cf2f13ebe3eac45cc71a8)

Author SHA1 Message Date
Tatsuhiro Tsujikawa ca6b46db84 Generate libaria2 API doc from aria2.h 2013-05-09 23:49:30 +09:00
Tatsuhiro Tsujikawa 8940d2aafd Change the way to receive resulting gids in addUri, addMetalink 2013-05-09 21:28:24 +09:00
Tatsuhiro Tsujikawa b733431ac4 Add DownloadHandle::getNumFiles and getFile API 2013-05-09 00:48:41 +09:00
Tatsuhiro Tsujikawa d50021d045 Use trunc as default value for --file-allocation on Android build 2013-05-06 19:31:40 +09:00
Tatsuhiro Tsujikawa 4c139eb039 Add TAG_DEPRECATED in DeprecatedOptionHandler ctor 2013-05-06 19:24:13 +09:00
Tatsuhiro Tsujikawa 512f87f4ff Fix compiler warning 2013-05-06 19:23:17 +09:00
Tatsuhiro Tsujikawa 5bc5665c6a Support off64_t for Android build
Android NDK R8e does not provide ftruncate64, but bionic has the
assembler code to access kernel function. We borrowed those
ftruncate64.S files from android source code repository.  It turns out
that x86 asm.h in NDK R8e is also broken, so latest asm.h was also
borrowed.
2013-05-06 19:12:17 +09:00
Tatsuhiro Tsujikawa 3a4acead2d Reset global::globalHaltRequested to 0 in MultiUrlRequestInfo::prepare() 2013-05-05 17:47:14 +09:00
Tatsuhiro Tsujikawa 1b920e4011 Add --enable-libaria2 configure option
By default, libaria2 feature is disabled. Use --enable-libaria2
to enable it. libaria2 static build is also disabled by default.
Use --enable-static to enable it.
2013-05-05 00:37:11 +09:00
Tatsuhiro Tsujikawa 2bf2dba544 Merge branch 'libaria2' 2013-05-05 00:13:17 +09:00
Tatsuhiro Tsujikawa 22b3e0a4ae Fix PREF_QUIET is set to A2_V_TRUE even if standalone is true 2013-05-05 00:05:41 +09:00
Tatsuhiro Tsujikawa ebfc5f55e5 Add SessionConfig to store per Session config
sessionConfigSetKeepRunning() was removed and SessionConfig has
keepRunning member instead. Signal handlers are now all prepared in
MultiUrlRequestGroup object. Setting SessionConfig.useSignalHandler to
false will avoid signal handler setup.
2013-05-04 23:56:19 +09:00
Tatsuhiro Tsujikawa 4410f0e56c Treat response is completed if EOF is received before streamFilter completes 2013-05-04 22:44:08 +09:00
Tatsuhiro Tsujikawa 7d55341fde Fix event polling not working with no downloads but keepRunning_ is true 2013-05-02 12:44:55 +09:00
Tatsuhiro Tsujikawa 98b132b4d1 Receive reference, not copy 2013-05-02 11:47:29 +09:00
Tatsuhiro Tsujikawa d07b3ff8d9 Suppress console output for none-standalone mode 2013-05-02 11:30:42 +09:00
Tatsuhiro Tsujikawa 315c05ea3c Suppress console log output for library use, enclose Platform in try-catch
Still need to suppress global::cerr and global::cout
2013-05-02 10:25:28 +09:00
Tatsuhiro Tsujikawa f5d5d8fa8e Fix empty unknown option name in OptionParser::parse 2013-05-02 10:19:30 +09:00
Tatsuhiro Tsujikawa 43895155e0 Don't enter daemon mode if standalone is false 2013-05-02 10:08:47 +09:00
Tatsuhiro Tsujikawa aee621b3d4 Don't exit on error in option_processing
Still it exits when -v or -h is given. They are now guarded by
standalone variable and only do so when it is true.
2013-05-02 10:03:00 +09:00
Tatsuhiro Tsujikawa e5cccd335c Add addMetalink API function 2013-05-02 09:40:27 +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 a456d83de0 Update API doc 2013-05-01 17:15:43 +09:00
Tatsuhiro Tsujikawa bbc8866cfb Add removeDownload, pauseDownload and unpauseDownload API function 2013-05-01 16:58:34 +09:00
Tatsuhiro Tsujikawa 4c50544f1a Rename DOWNLOAD_STATUS as DownloadStatus 2013-05-01 13:39:54 +09:00
Tatsuhiro Tsujikawa 2109ba23a8 Add DownloadHandle::getFiles() API function 2013-05-01 13:38:30 +09:00
Tatsuhiro Tsujikawa 5e64d4c9a9 Expose struct DownloadHandle interface to public API directly 2013-05-01 11:58:25 +09:00
Tatsuhiro Tsujikawa 8f659f49ec Rename gidToString as gidToHex, add hexToGid and isNull 2013-04-30 22:51:05 +09:00
Tatsuhiro Tsujikawa 1df4adefb5 Add accessors for DownloadHandle
Added downloadGetBitfield, downloadGetNumPieces,
downloadGetConnections, downloadGetErrorCode,
downloadGetFollowedBy, downloadGetBelongsTo and
downloadGetDir functions.
2013-04-30 22:42:23 +09:00
Tatsuhiro Tsujikawa d1252dcc5f Move aria2api.{cc,h} to libaria2_la_SOURCES 2013-04-30 21:47:05 +09:00
Tatsuhiro Tsujikawa db2e22132d Merge branch 'libuv-eventpoll' of https://github.com/nmaier/aria2 into nmaier-libuv-eventpoll 2013-04-30 14:53:42 +09:00
Tatsuhiro Tsujikawa 549dd5b2a7 uitos: Fix off-by-one error bug 2013-04-29 23:53:23 +09:00
Nils Maier a1a3e21f73 LibUV: Revert unrelated change 2013-04-28 21:54:35 +02:00
Nils Maier e700ebd3e9 LibUV: Reorder event poll preference
*nix will keep epoll/kqueue/port as the default (when available), while
Windows, lacking all of these, will default to libuv (when available)
2013-04-28 21:44:06 +02:00
Nils Maier 6b7a51d5e0 Close GZipFiles in the d'tor 2013-04-28 21:32:51 +02:00
Tatsuhiro Tsujikawa 28849e3ddf Add gidToString and getActiveDownload API functions 2013-04-27 01:26:59 +09:00
Tatsuhiro Tsujikawa 9734fa5447 Call onEndOfRun() on oneshot == true as well 2013-04-27 01:23:54 +09:00
Tatsuhiro Tsujikawa 0ef5f4eea1 Add getDownloadHandle API 2013-04-27 00:57:18 +09:00
Tatsuhiro Tsujikawa 6fcf274f27 Add initialization function and addUri API function for libaria2 2013-04-26 23:59:48 +09:00
Tatsuhiro Tsujikawa 90abec8a36 Move initialization code in aria2::main to struct Context 2013-04-25 21:46:31 +09:00
Tatsuhiro Tsujikawa bbb978948d Add preliminary libtool files for libaria2 2013-04-25 11:38:26 +09:00
Tatsuhiro Tsujikawa b05454657f Fix cached data is not flushed when downloaded data is less than 16KiB 2013-04-23 23:00:11 +09:00
Tatsuhiro Tsujikawa 9abbd5c917 Use INFO level log when get_associate failed in PortEventPoll::poll() 2013-04-20 21:03:38 +09:00
Nils Maier 539fda0b4f LibUV: Code cleanup 2013-04-17 15:53:17 +02:00
Nils Maier 1cd5dcc9b6 LibUV: Correct event removal 2013-04-17 15:53:06 +02:00
Tatsuhiro Tsujikawa 8a431bfc89 Don't wait for AAAA query response if A query response has been received
If we got IPv4 lookup response, we don't wait for IPv6 lookup
response. This is because DNS server may drop AAAA query and we have
to wait for the long time before timeout. We don't do the inverse,
because, based on todays deployment of DNS server, almost all of them
can respond A query just fine.
2013-04-14 21:12:46 +09:00
Tatsuhiro Tsujikawa 5e245c3397 Fix compile error without SSL/TLS lib 2013-04-14 18:43:16 +09:00
Tatsuhiro Tsujikawa 2e39fd6273 Check configured addresses again if previous check found none of them
Currently, aria2 checks configured addresses at the startup. But there
are chances that interfaces are not setup at that moment. For example,
if aria2 is used as daemon, it may start before network interfaces
up. To workaround this, we check addresses again if both addresses are
not configured at the startup.
2013-04-13 21:16:53 +09:00
Tatsuhiro Tsujikawa 4070113ef0 Save options directly specified for download in --save-session
This change makes --save-session save only options specified for
download, more specifically, options in command-line, -i file and via
RPC. The other options from conf file and default values are not
saved.  This will drastically decrease the size of session file.
2013-04-11 23:13:21 +09:00
Tatsuhiro Tsujikawa 07d38e31ad Save URI returned only from FileEntry::getRemainingUris()
The currently used URIs are inserted back into remaining URI list in
FileEntry::putBackRequest(), which overlaps to some of the URIs in
spentUris_. If we save spent URIs, each time save is performed, the
number of URIs are increased due to this overlap. This change fixes
this bug.
2013-04-11 22:45:37 +09:00
Nils Maier b874c7df11 AppleMD: Add destructors to make compilers happy 2013-04-10 08:51:57 +02:00
Nils Maier 9acd3df3cb LibUV: Implement LibuvEventPoll
LibUV event will use the best available polling method on a system, kind
of like aria2 does already with the different *EventPoll
implementations.
However, libuv may support different/newer polling mechanisms; for
example on Windows it will use IO Completion Ports which are superior to
select() ;)
2013-04-10 08:47:20 +02:00
Tatsuhiro Tsujikawa b35fbd3172 Print linked 3rd party libraries with version in `aria2c -v` output 2013-04-10 00:23:39 +09:00
Tatsuhiro Tsujikawa d0ff31faf8 Format MessageDigest.cc 2013-04-09 23:46:25 +09:00
Tatsuhiro Tsujikawa f333231c7a Fix broken MessageDigst::getSupportedHashTypeString() 2013-04-09 23:45:28 +09:00
Tatsuhiro Tsujikawa 15e1a79914 Update TLSSession::checkDirection() doc
Make it clear that TLS_WANT_READ must be returned if underlying
SSL/TLS lib does not indicate I/O direction. This is because
SocketCore sets wantRead_ = true when TLS_WANT_READ is returned and
otherwise sets wantWrite_ = true. We only want to set wantWrite_ =
true iff we have some pending data to send.
2013-04-09 01:12:51 +09:00
Tatsuhiro Tsujikawa 83b801a0a5 Merge branch 'appletls-wantread' of https://github.com/nmaier/aria2 into nmaier-appletls-cred-kc 2013-04-09 01:09:16 +09:00
Nils Maier 16876a5334 AppleTLS: Fixup checkDirection() to return WANT_READ by default 2013-04-08 17:09:32 +02:00
Nils Maier 82a861f8d8 AppleTLS: Support credentials via KeyChain fingerprints 2013-04-08 06:45:53 +02:00
Tatsuhiro Tsujikawa 89cf6c0468 Append comment to endif 2013-04-06 16:34:49 +09:00
Tatsuhiro Tsujikawa 457356ad13 Fix make distcheck 2013-04-06 16:33:15 +09:00
Tatsuhiro Tsujikawa ddad275dbd Make log level INFO in addTrustedCACertFile()
With WARN level, they will be always printed on Mac OS and old GNUTLS
build which does not have its API.
2013-04-06 16:15:32 +09:00
Nils Maier 5709746820 AppleTLS: Block worst ciphers and log session information 2013-04-05 23:31:20 +02:00
Nils Maier 0bcbd947b4 AppleTLS: Implement AppleTLS and Apple Message Digest 2013-04-05 23:10:47 +02:00
Tatsuhiro Tsujikawa b292ae1305 Use info level log for system trusted ca imports failure
This is because on some platforms (gnutls on cygwin for example),
library always fails for this function and getting ERROR every time
aria2c invoked is too hard.
2013-04-05 01:07:43 +09:00
Tatsuhiro Tsujikawa 7ce725098b Remove default value for deprecated --enable-async-dns6 to suppress warning 2013-04-03 02:27:45 +09:00
Tatsuhiro Tsujikawa 8580c98bce Abstract TLS session implementation
Now TLS session object is abstracted as TLSSession class. Currently,
we have GNUTLS and OpenSSL implementations.
2013-04-03 02:24:41 +09:00
Tatsuhiro Tsujikawa 19b5b7e214 Remove deprecated options: --enable-direct-io and --metalink-servers 2013-04-02 00:12:24 +09:00
Tatsuhiro Tsujikawa cd1f1fb56d Deprecate --enable-async-dns6
The IPv6 asynchronous name resolver is enabled if the host has at
least one interface with IPv6 address configured (the loopback address
will not be counted), which is roughly the same behaviour of the
standard getaddrinfo(3). To disable IPv6 asynchronous name resolver,
use --disable-ipv6.
2013-04-02 00:02:56 +09:00
Tatsuhiro Tsujikawa 26972b8535 Rewrite backup connection handling
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.
2013-04-01 23:51:33 +09:00
Tatsuhiro Tsujikawa cf23e3e11d Fix compile error without c-ares 2013-04-01 02:08:53 +09:00
Tatsuhiro Tsujikawa d575e3cc77 Rewrite async DNS portion without exception 2013-04-01 02:03:22 +09:00
Tatsuhiro Tsujikawa 497c1dd8c9 Use AsyncNameResolverMan in NameResolveCommand 2013-04-01 01:56:51 +09:00
Tatsuhiro Tsujikawa 12a3eaf233 Fix uninitialized UDPTrackerClient::numWatchers_ 2013-04-01 01:24:57 +09:00
Tatsuhiro Tsujikawa b5a6c39262 Use AsyncNameResolverMan in DHTEntryPointNameResolveCommand 2013-04-01 01:24:18 +09:00
Tatsuhiro Tsujikawa 597e1a5c1b Implement simple Happy Eyeballs for HTTP/FTP downloads 2013-04-01 00:12:27 +09:00
Tatsuhiro Tsujikawa d671d8bf36 mingw: Ignore tunnel interface and address in 169.254.* 2013-03-31 18:02:46 +09:00
Tatsuhiro Tsujikawa b9fb15f884 Use GetAdaptersAddresses for Mingw 2013-03-31 18:02:46 +09:00
Tatsuhiro Tsujikawa f4a0987544 Check non-loopback (and non-linklocak for IPv6) address is configured
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.
2013-03-31 18:02:45 +09:00
Tatsuhiro Tsujikawa 56fac58b4d Parallel A and AAAA record lookups with c-ares 2013-03-31 18:02:45 +09:00
Tatsuhiro Tsujikawa 5535ed5f95 Code cleanup 2013-03-18 22:45:07 +09:00
Tatsuhiro Tsujikawa d88e815033 Fix bug that invalid range error when requesting range starting 0
Since the change b782a56b, we use endOffsetOverride_ as the return
value of getEndByte(). But aria2 does not send Range header field when
range starts 0 (this is because some server returns error if it
received Range: 0-), and the HttpRequest::isRangeSatisfied() checks
the equality of getEndByte() and the end byte in response header and
fails. The fix is send Range header if getEndByte() is set.
2013-03-18 22:01:36 +09:00
Tatsuhiro Tsujikawa 0fa92911d7 util.cc: Include only signal.h for opensolaris build 2013-03-17 15:42:50 +09:00
Tatsuhiro Tsujikawa 0741a14486 Revert 6b55f5d3 because it breaks opensolaris build 2013-03-17 15:42:16 +09:00
Tatsuhiro Tsujikawa 18ad88088d Fix typo in GZipFile.h spelling 2013-03-16 20:40:39 +09:00
Tatsuhiro Tsujikawa 85de8b0642 Revert DownloadEngine.cc change in 6b55f5d3 because Debian Lenny breaks 2013-03-04 22:32:51 +09:00
Tatsuhiro Tsujikawa 588ee2f1cc GZipFile: Move buf_, buflen_ to initializer list 2013-03-03 22:55:44 +09:00
Tatsuhiro Tsujikawa 43cb2d880a Rewrite GZipFile::vprintf()
MINGW does not have vasprintf(), so we use _vscprintf() and
vsnprintf(). We want to reuse buffer, so for non-MINGW we use
vsnprintf() with retrying doubling buffer size if output is truncated.
2013-03-03 21:49:42 +09:00
Tatsuhiro Tsujikawa e17d0f8d4e Bring back datetime in console log 2013-03-03 18:35:07 +09:00
Tatsuhiro Tsujikawa 66a85777ad Document UDP tracker in manual 2013-03-03 18:28:25 +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
Tatsuhiro Tsujikawa 421ae13d40 Run checksum check if -V and -c are used and file is completed
With -c option, aria2 can continue download after the existing file
position. If it is not completed, then after completion aria2 runs
checksum checking if available. But if existing file has already been
completed, then CreateRequestCommand exits without issuing checksum
checking. And aria2 treats it download error because it needs checksum
verification but it has not been done. This change fixes this by
properly checking download state and issue checksum checking before
CreateRequestCommand.
2013-03-03 17:18:12 +09:00
Tatsuhiro Tsujikawa 9b99875478 Add writeOptionLine() to format 1 line of option name/value pair 2013-03-03 14:12:59 +09:00
Tatsuhiro Tsujikawa 6b55f5d393 Do changes in 8aa1db6 in other places which include signal.h 2013-03-03 13:41:03 +09:00
Tatsuhiro Tsujikawa 7c66d1952a Merge branch 'mingw-signal' of https://github.com/nmaier/aria2 into nmaier-mingw-signal 2013-03-03 13:28:51 +09:00
Tatsuhiro Tsujikawa 122e5929c1 SessionSerializer: Remove check fp because it is always true 2013-03-03 13:20:54 +09:00
Tatsuhiro Tsujikawa f4469b79aa SessionSerializer crash when filename length is less than 3 2013-03-03 13:19:52 +09:00
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