Commit Graph

2929 Commits (c0b60eb087ea47c0c9bd995b5398ed9f8edc907a)

Author SHA1 Message Date
Tatsuhiro Tsujikawa 7ac096c3c0 Merge branch 'signals-again' of https://github.com/nmaier/aria2 into nmaier-signals-again 2013-05-17 21:19:42 +09:00
Nils Maier b7ef53b13d OSX (now) needs signal.h for sigaction 2013-05-17 01:48:53 +02:00
Nils Maier 51ddcaf5b1 AppleTLS: Properly support Snow Leopard (10.6)
Tested on 10.6.8 + XCode 4.2 (llvm-gcc-4.2, clang)
2013-05-17 01:42:01 +02:00
Tatsuhiro Tsujikawa c7c4d46672 Add changeOption and DownloadHandle::getOption API
In aria2c.rst, define section label for "Input File" section so that
it can be referenced from other document.
2013-05-16 23:09:19 +09:00
Tatsuhiro Tsujikawa 8e8fb9ee36 Add addTorrent API 2013-05-15 23:29:28 +09:00
Tatsuhiro Tsujikawa a8ef703b89 Update doc 2013-05-15 22:58:55 +09:00
Tatsuhiro Tsujikawa a4a4a10490 Remove NULL check for pref because pref is always non NULL 2013-05-15 22:51:35 +09:00
Tatsuhiro Tsujikawa fc0982587b Release elements in routineCommands_ on destruction 2013-05-15 22:50:51 +09:00
Tatsuhiro Tsujikawa cef6db17ba Add changePosition API 2013-05-15 00:50:55 +09:00
Tatsuhiro Tsujikawa 4f5d26a0c7 Use BtFileMode for TorrentAttribute::mode 2013-05-15 00:09:51 +09:00
Tatsuhiro Tsujikawa 5dcc2b7842 Add DownloadHandle::getBtMetaInfo() API 2013-05-14 23:00:21 +09:00
Tatsuhiro Tsujikawa b0b5e0df38 Enable multicast loopback in Bt LPD 2013-05-14 21:45:27 +09:00
Tatsuhiro Tsujikawa e350df2d75 Add download event callback API and its example 2013-05-11 19:40:24 +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 9f4f888e39 Make DownloadHandle::getNumPieces() return int 2013-05-10 21:52:46 +09:00
Tatsuhiro Tsujikawa 1a953d5f93 Add DownloadHandle::getInfohash() and getPieceLength() 2013-05-10 21:51:41 +09:00
Tatsuhiro Tsujikawa 1b6827b060 Revert d50021d045
It is safe to use prealloc for default, because of legacy fs (e.g.,
vfat) usage in Android.
2013-05-10 21:14:03 +09:00
Tatsuhiro Tsujikawa c056f747c6 Install libaria2.pc only when libaria2 is enabled 2013-05-10 21:12:30 +09:00
Tatsuhiro Tsujikawa 233501f768 Enable TLS1.1 with gnutls build 2013-05-10 00:49:06 +09:00
Tatsuhiro Tsujikawa fb31e44d60 Change error code -1 to just negative error code 2013-05-10 00:08:36 +09:00
Tatsuhiro Tsujikawa 16635f94ea Make DownloadHandle class 2013-05-10 00:00:36 +09:00
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