Giter Site home page Giter Site logo

aria2 / aria2 Goto Github PK

View Code? Open in Web Editor NEW
33.6K 732.0 3.4K 30.69 MB

aria2 is a lightweight multi-protocol & multi-source, cross platform download utility operated in command-line. It supports HTTP/HTTPS, FTP, SFTP, BitTorrent and Metalink.

Home Page: https://aria2.github.io/

License: GNU General Public License v2.0

Shell 0.24% C++ 94.19% C 3.65% Makefile 0.79% M4 1.04% Dockerfile 0.08%
cpp11 http ftp sftp bittorrent rpc download metalink

aria2's Issues

Download error with -x5 -k1M.

Download started fine but after a while it start to lost connection then error
2013-05-23 22:49:22.888032 [DEBUG] [AbstractCommand.cc:437] CUID#9 - Aborting download
If only use -x5 it lost connection to 1 but continue to work, log here.

Adding new nonverbose log level

Hi,

Currently the possible log levels are:

  • debug
  • info
  • notice
  • warn
  • error

Debug and Info are too verbose, the rest is only for exceptional things (that you don't want to happen). I desperately need a new log level, which would be very simple, only informing you about what's going on.

[2011-11-11 11:11:11] test.torrent started to download
[2011-11-11 11:11:21] test.torrent is at 12% size: XXX MB estimated time left:...
[2011-11-11 11:11:31] test.torrent is at 25% size: XXX MB estimated time left:...
[2011-11-11 11:11:41] test.torrent  is at 41% size: XXX MB estimated time left:...
[2011-11-11 11:11:11] test.torrent  is at 80% size: XXX MB estimated time left:...
[2011-11-11 11:11:11] test.torrent  has finished downloading
[2011-11-11 11:11:11] test2.torrent  has finished downloading
[2011-11-11 11:11:11] test2.torrent is at 14% size: YYY MB estimated time left:...
[2011-11-11 11:11:11] ERROR test2.torrent failed downloading: "No connection"

Something like this, which informs me about the "normal" events as well, lets me keep track of my downloads, if there was an error, but not too verbose. Do you think this could be implemented?

Some options doesn't work when adding tasks via xml-rpc

Hi,

As far as I've tested, 'allow-overwrite' and 'auto-file-renaming' are not functional when adding tasks via xml-rpc like this:

aria2.addUri(['http://g.cn'], {'allow-overwrite': True, 'auto-file-renaming': False})

I haven't tested other options, which may also have this problem.

OSX clang compiler error due to old libstdlibc++

The clang that comes with XCode on OSX uses the ancient libstdlibc++ 4.2.1 (IIRC) by default. To have the aria2 code compile one needs to add -stdlib=-stdlib=libc++ to avoid errors about undefined std::shared_ptr, etc.

session file and config file (redundancy)

shouldn't the session file ignore prefs already set in the config file ?
minimizing the size of the file and allowing resuming from differents OSs ? eg: the download location changes in each os while pointing to the same folder

Option enable-mmap doesn't work on OpenWrt

I'm so happy Aria2 finally has a cache-like option: enable-mmap! I built it for OpenWrt, but when I try to run "aria2c --enable-mmap=true" it says unrecognized option `--enable-mmap'. I can't find enable-mmap option using "aria2c -h#all" either, even though I can find option "--force-save" and use it, which was added in the latest version. However, when I build it on Ubuntu, it works all right, do you have any ideas?

UPDATE: I've noticed HAVE_MMAP is not set to 1 when do the configure check. In the Configure.log file, it says "Checking working mmap ....no". But I guess mmap should be available on Openwrt, so I modified Configure file and skipped the mmap check, looks all good right now.

How to properly seed torrents & maintain a session

Hi,

I've been using aria2 for a few days now, it is a great tool but there's one thing I can't figure out. I want to seed a few torrents simultaneously, but I can't configure it properly.

My config:

continue
dir=/home/kuba/Downloads
file-allocation=falloc
log-level=info
max-connection-per-server=4
min-split-size=5M
enable-rpc
enable-dht
bt-save-metadata
rpc-save-upload-metadata
force-save
#seed-ratio=3
check-unverified
bt-seed-unverified
save-session=/home/kuba/.aria2/session
input-file=/home/kuba/.aria2/session

What I'm aiming for is to run an instance of aria2 and then add downloads via rpc (I use webui-aria2). What happened to me when I first tried to seed multiple torrents was that torrents disappeared entirely after completion. I then figured out saving sessions, using input files, saving metadata, and recently force-save'ing. That worked fine until I got 4 jobs at the same time (4 metadata + 4 actual seeding jobs). But then I restarted the instance and I can see 4 metadata jobs, but no seeding is done (or maybe they disappear from rpc interface, I can't really tell). When I restart one of the metadata jobs, they disappear too from the webui but they're saved in the session file and they're back up again after restarting (metadata jobs, still no actual seeding).

I have no idea where to go from now, the output is cluttered with errors saying that udp is not supported yet, I don't know if it has any effect on this case.

By the way, if I can't connect to trackers via udp, does it mean I'm not connected to as many peers as I could be?

Feature request: Don't lost completed jobs between session...

When download of torrent job is done, aria2 session doesn't save more the job in file session. If you need resume this job for seeding is needed re-add the torrent file in correct directory.

For a few torrents it's not a problem but if you try use aria2 like a torrent manager with a large number of torrent jobs is painfull resume all.

I suggest the inclusion of one option like "--persistent-job", that force aria2 always save the related job in the save session file. And it can work for all types of jobs for log purpose...

Thank for the attention and all excellent work in aria2.

Why do you use autotools

There are many usefull modern build systems such as cmake. it have ctest that will work perfectly with your cppunit tests. cpack can provide convenient deb and rpm packages for current user platform. of course you can make cmake-tollchain and create build for any platform you want: i586, amd64, arm or for some shit platforms like win32, win64 and mac os

Support async DNS resolving via libuv uv_getaddrinfo

libuv, which aria2c already support as a poller, also offers async DNS resolvers via uv_getaddrinfo. It would be nice to have this as an alternative in place.

  • First of all: refactor code to have a generic (async) DNS Resolver interface
  • Implement that new generic interface for c-ares. Right now, there are quite a few files coupled with the specific implementation.
  • Implement a libuv uv_getaddrinfo based resolver.

This would be great for windows builds: use libuv poll + resolver and get rid of the c-ares "dependency" in the process.

Reload input file

Hello, I am using aria2 specially for torrent, is there a way to just reload the input file in order to add/remove downloads without stop seeding and using one aria2 process?
It could be a nice-have.
Thank you very much for aria2

--enable-rpc fail on OS X 10.8

% aria2c --enable-rpc --rpc-listen-all=true --rpc-allow-origin-all -c

[NOTICE] IPv4 RPC: listening to port 6800

[NOTICE] IPv6 RPC: listening to port 6800

[ERROR] Failed to load trusted CA certificates from system. Cause: An unimplemented or disabled feature has been requested.

no matter i run aria2c with sudo or not, the result shows like the lines above.

any ideas?

rst2html is usually installed as rst2html.py

At least if you pip install docutils (or autoinstall it as a dependency for sphinx), it installed as rst2html.py and must be called as such. Calling just rst2html will error out during make in this scenario.

As the debian folks were kind enough to fuck up their packaging by renaming the tool to just rst2html one might still need to detect which of rst2html,rst2html.py, if any, is the correct script name to call.

Auto detect encoding of URIs and file names

Currently aria2 use percent-encoded file names if the encoding of them can not be recognized.
It may be better if you can use libraries such as Mozilla's Universal Charset Detector to detect them automatically and decode them.

Crossdomain post with HTTP authentication in JSON-RPC

I'm writing a frontend for aria2 with pure javascript and html using JSON-RPC. So that no backend is needed.

But when I trying to add support for rpc-user/rpc-passwd(HTTP basic authentication), it don't work.
When trying to add header Authentication for XmlHttpRequest, browser will sending a OPTIONS request before POST.
http://stackoverflow.com/questions/1099787/jquery-ajax-post-sending-options-as-request-method-in-firefox
https://developer.mozilla.org/en/http_access_control
http://www.w3.org/TR/cors/

aria2 doesn't support this method now. You can test this here with http://<username>:<password>@127.0.0.1:6800/jsonrpc as JSON-RPC Path.

I tried add

diff --git a/src/HttpServer.h b/src/HttpServer.h
index a001737..6cba2e9 100644
--- a/src/HttpServer.h
+++ b/src/HttpServer.h
@@ -135,6 +135,8 @@ public:
     return socketRecvBuffer_;
   }

+  std::string GetAllowOrigin() const { return allowOrigin_; }
+
   void setAllowOrigin(const std::string& allowOrigin)
   {
     allowOrigin_ = allowOrigin;
diff --git a/src/HttpServerCommand.cc b/src/HttpServerCommand.cc
index 0e13094..a6f066e 100644
--- a/src/HttpServerCommand.cc
+++ b/src/HttpServerCommand.cc
@@ -164,6 +164,24 @@ bool HttpServerCommand::execute()
         e_->addCommand(this);
         return false;
       }
+      if (httpServer_->getMethod() == "OPTIONS") {
+        std::string access_control_headers;
+        if (!httpServer_->GetAllowOrigin().empty()) {
+            access_control_headers += "Access-Control-Allow-Methods: POST, GET, OPTIONS\r\n"
+                                     "Access-Control-Max-Age: 1728000\r\n";
+            if (!header->find("access-control-request-headers").empty()) {
+                access_control_headers += "Access-Control-Allow-Headers: ";
+                access_control_headers += header->find("access-control-request-headers");
+                access_control_headers += "\r\n";
+            }
+        }
+        httpServer_->feedResponse(200, access_control_headers);
+        Command* command =
+          new HttpServerResponseCommand(getCuid(), httpServer_, e_, socket_);
+        e_->addCommand(command);
+        e_->setNoWait(true);
+        return true;
+      }
       if(!httpServer_->authenticate()) {
         httpServer_->disableKeepAlive();
         httpServer_->feedResponse

to make it work.

First line of configuration file not read properly

image

This issue seems to occur on Windows only.
aria2c doesn't read the first line correctly, always giving "unknown option" warning for whatever option specified. I have to put a comment there. As you can see, comment is not recognized either.

Task management functions

--save-session can not be saved in order to complete the task, do not automatically BitTorrent restart kinds.
ps: I hope to be able to support task management

Resume Seeding via RPC ?

Yeah , aria2 is cool , but i have one last question is how can i resume seeding via RPC ?

I read the aria2 docs and try several parameter such as 'check-integrity' 'bt-seed-unverified' but no luck .

Ubuntu Static compile issue

Commands I ran

autoreconf -i

./configure ARIA2_STATIC=yes

make

This is the beginning of the error

SocketCore.cc:1088: warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
util.cc:1231: warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
util.cc:1273: warning: Using 'getpwuid' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/i386-linux-gnu/libgnutls.a(gnutls_mpi.o):function _gnutls_x509_read_int: error: undefined reference to 'asn1_read_value'
/usr/lib/i386-linux-gnu/libgnutls.a(gnutls_mpi.o):function _gnutls_x509_read_int: error: undefined reference to 'asn1_read_value'
/usr/lib/i386-linux-gnu/libgnutls.a(gnutls_mpi.o):function _gnutls_x509_write_int: error: undefined reference to 'asn1_write_value'
/usr/lib/i386-linux-gnu/libgnutls.a(gnutls_pk.o):function _gnutls_encode_ber_rs: error: undefined reference to 'asn1_create_element'
/usr/lib/i386-linux-gnu/libgnutls.a(gnutls_pk.o):function _gnutls_encode_ber_rs: error: undefined reference to 'asn1_delete_structure'
/usr/lib/i386-linux-gnu/libgnutls.a(gnutls_pk.o):function _gnutls_encode_ber_rs: error: undefined reference to 'asn1_delete_structure'
/usr/lib/i386-linux-gnu/libgnutls.a(gnutls_pk.o):function _gnutls_decode_ber_rs: error: undefined reference to 'asn1_create_element'
/usr/lib/i386-linux-gnu/libgnutls.a(gnutls_pk.o):function _gnutls_decode_ber_rs: error: undefined reference to 'asn1_der_decoding'
/usr/lib/i386-linux-gnu/libgnutls.a(gnutls_pk.o):function _gnutls_decode_ber_rs: error: undefined reference to 'asn1_delete_structure'
/usr/lib/i386-linux-gnu/libgnutls.a(gnutls_pk.o):function _gnutls_decode_ber_rs: error: undefined reference to 'asn1_delete_structure'
/usr/lib/i386-linux-gnu/libgnutls.a(gnutls_global.o):function gnutls_global_init: error: undefined reference to 'asn1_check_version'
/usr/lib/i386-linux-gnu/libgnutls.a(gnutls_global.o):function gnutls_global_init: error: undefined reference to 'asn1_array2tree'
/usr/lib/i386-linux-gnu/libgnutls.a(gnutls_global.o):function gnutls_global_init: error: undefined reference to 'asn1_array2tree'
/usr/lib/i386-linux-gnu/libgnutls.a(gnutls_global.o):function gnutls_global_init: error: undefined reference to 'asn1_check_version'
/usr/lib/i386-linux-gnu/libgnutls.a(auth_cert.o):function _gnutls_proc_cert_cert_req: error: undefined reference to 'asn1_create_element'
/usr/lib/i386-linux-gnu/libgnutls.a(auth_cert.o):function _gnutls_proc_cert_cert_req: error: undefined reference to 'asn1_der_decoding'
/usr/lib/i386-linux-gnu/libgnutls.a(auth_cert.o):function _gnutls_proc_cert_cert_req: error: undefined reference to 'asn1_der_decoding_startEnd'
/usr/lib/i386-linux-gnu/libgnutls.a(gnutls_sig.o):function pk_prepare_hash: error: undefined reference to 'asn1_create_element'
/usr/lib/i386-linux-gnu/libgnutls.a(gnutls_sig.o):function pk_prepare_hash: error: undefined reference to 'asn1_write_value'
/usr/lib/i386-linux-gnu/libgnutls.a(gnutls_sig.o):function pk_prepare_hash: error: undefined reference to 'asn1_write_value'
/usr/lib/i386-linux-gnu/libgnutls.a(gnutls_sig.o):function pk_prepare_hash: error: undefined reference to 'asn1_write_value'
/usr/lib/i386-linux-gnu/libgnutls.a(gnutls_sig.o):function pk_prepare_hash: error: undefined reference to 'asn1_der_coding'
/usr/lib/i386-linux-gnu/libgnutls.a(gnutls_sig.o):function pk_prepare_hash: error: undefined reference to 'asn1_der_coding'
/usr/lib/i386-linux-gnu/libgnutls.a(gnutls_dh_primes.o):function gnutls_dh_params_import_pkcs3: error: undefined reference to 'asn1_der_decoding'
/usr/lib/i386-linux-gnu/libgnutls.a(gnutls_dh_primes.o):function gnutls_dh_params_export_pkcs3: error: undefined reference to 'asn1_der_coding'
/usr/lib/i386-linux-gnu/libgnutls.a(gnutls_dh_primes.o):function gnutls_dh_params_export_pkcs3: error: undefined reference to 'asn1_der_coding'
/usr/lib/i386-linux-gnu/libgnutls.a(pkcs11.o):function pkcs11_obj_import: error: undefined reference to 'p11_kit_uri_set_attribute'
/usr/lib/i386-linux-gnu/libgnutls.a(pkcs11.o):function pkcs11_obj_import: error: undefined reference to 'p11_kit_uri_get_token_info'
/usr/lib/i386-linux-gnu/libgnutls.a(pkcs11.o):function pkcs11_obj_import: error: undefined reference to 'p11_kit_uri_get_module_info'
/usr/lib/i386-linux-gnu/libgnutls.a(pkcs11.o):function pkcs11_obj_import: error: undefined reference to 'p11_kit_uri_set_attribute'
/usr/lib/i386-linux-gnu/libgnutls.a(pkcs11.o):function pkcs11_obj_import: error: undefined reference to 'p11_kit_uri_set_attribute'
/usr/lib/i386-linux-gnu/libgnutls.a(pkcs11.o):function find_flags: error: undefined reference to 'p11_kit_uri_match_token_info'
/usr/lib/i386-linux-gnu/libgnutls.a(pkcs11.o):function find_flags: error: undefined reference to 'p11_kit_uri_match_module_info'
/usr/lib/i386-linux-gnu/libgnutls.a(pkcs11.o):function find_token_num: error: undefined reference to 'p11_kit_uri_get_token_info'
/usr/lib/i386-linux-gnu/libgnutls.a(pkcs11.o):function find_token_num: error: undefined reference to 'p11_kit_uri_get_module_info'
/usr/lib/i386-linux-gnu/libgnutls.a(pkcs11.o):function find_obj_url: error: undefined reference to 'p11_kit_uri_match_token_info'
/usr/lib/i386-linux-gnu/libgnutls.a(pkcs11.o):function find_obj_url: error: undefined reference to 'p11_kit_uri_match_module_info'
/usr/lib/i386-linux-gnu/libgnutls.a(pkcs11.o):function find_obj_url: error: undefined reference to 'p11_kit_uri_get_attribute'
/usr/lib/i386-linux-gnu/libgnutls.a(pkcs11.o):function find_obj_url: error: undefined reference to 'p11_kit_uri_get_attribute'
/usr/lib/i386-linux-gnu/libgnutls.a(pkcs11.o):function find_obj_url: error: undefined reference to 'p11_kit_uri_get_attribute'
/usr/lib/i386-linux-gnu/libgnutls.a(pkcs11.o):function gnutls_pkcs11_add_provider: error: undefined reference to 'p11_kit_load_initialize_module'
/usr/lib/i386-linux-gnu/libgnutls.a(pkcs11.o):function gnutls_pkcs11_add_provider: error: undefined reference to 'p11_kit_finalize_module'
/usr/lib/i386-linux-gnu/libgnutls.a(pkcs11.o):function pkcs11_get_info: error: undefined reference to 'p11_kit_uri_get_attribute'
/usr/lib/i386-linux-gnu/libgnutls.a(pkcs11.o):function pkcs11_get_info: error: undefined reference to 'p11_kit_uri_get_token_info'
/usr/lib/i386-linux-gnu/libgnutls.a(pkcs11.o):function pkcs11_get_info: error: undefined reference to 'p11_kit_space_strlen'
/usr/lib/i386-linux-gnu/libgnutls.a(pkcs11.o):function pkcs11_get_info: error: undefined reference to 'p11_kit_uri_get_token_info'
/usr/lib/i386-linux-gnu/libgnutls.a(pkcs11.o):function pkcs11_get_info: error: undefined reference to 'p11_kit_uri_get_module_info'
/usr/lib/i386-linux-gnu/libgnutls.a(pkcs11.o):function pkcs11_get_info: error: undefined reference to 'p11_kit_uri_get_module_info'
/usr/lib/i386-linux-gnu/libgnutls.a(pkcs11.o):function gnutls_pkcs11_init: error: undefined reference to 'p11_kit_initialize_registered'
/usr/lib/i386-linux-gnu/libgnutls.a(pkcs11.o):function gnutls_pkcs11_init: error: undefined reference to 'p11_kit_strerror'
/usr/lib/i386-linux-gnu/libgnutls.a(pkcs11.o):function gnutls_pkcs11_init: error: undefined reference to 'p11_kit_registered_modules'
/usr/lib/i386-linux-gnu/libgnutls.a(pkcs11.o):function gnutls_pkcs11_init: error: undefined reference to 'p11_kit_registered_module_to_name'
/usr/lib/i386-linux-gnu/libgnutls.a(pkcs11.o):function gnutls_pkcs11_deinit: error: undefined reference to 'p11_kit_finalize_module'
/usr/lib/i386-linux-gnu/libgnutls.a(pkcs11.o):function gnutls_pkcs11_deinit: error: undefined reference to 'p11_kit_finalize_registered'
/usr/lib/i386-linux-gnu/libgnutls.a(pkcs11.o):function pkcs11_url_to_info: error: undefined reference to 'p11_kit_uri_parse'
/usr/lib/i386-linux-gnu/libgnutls.a(pkcs11.o):function pkcs11_url_to_info: error: undefined reference to 'p11_kit_uri_new'
/usr/lib/i386-linux-gnu/libgnutls.a(pkcs11.o):function pkcs11_url_to_info: error: undefined reference to 'p11_kit_uri_free'
/usr/lib/i386-linux-gnu/libgnutls.a(pkcs11.o):function pkcs11_info_to_url: error: undefined reference to 'p11_kit_uri_format'
/usr/lib/i386-linux-gnu/libgnutls.a(pkcs11.o):function gnutls_pkcs11_obj_init: error: undefined reference to 'p11_kit_uri_new'
/usr/lib/i386-linux-gnu/libgnutls.a(pkcs11.o):function gnutls_pkcs11_obj_deinit: error: undefined reference to 'p11_kit_uri_free'
/usr/lib/i386-linux-gnu/libgnutls.a(pkcs11.o):function find_objs: error: undefined reference to 'p11_kit_uri_match_token_info'
/usr/lib/i386-linux-gnu/libgnutls.a(pkcs11.o):function find_objs: error: undefined reference to 'p11_kit_uri_match_module_info'
/usr/lib/i386-linux-gnu/libgnutls.a(pkcs11.o):function pkcs11_find_slot: error: undefined reference to 'p11_kit_uri_match_token_info'
/usr/lib/i386-linux-gnu/libgnutls.a(pkcs11.o):function pkcs11_find_slot: error: undefined reference to 'p11_kit_uri_match_module_info'
/usr/lib/i386-linux-gnu/libgnutls.a(pkcs11.o):function gnutls_pkcs11_token_get_info: error: undefined reference to 'p11_kit_space_strlen'
/usr/lib/i386-linux-gnu/libgnutls.a(pkcs11.o):function gnutls_pkcs11_token_get_info: error: undefined reference to 'p11_kit_uri_free'
/usr/lib/i386-linux-gnu/libgnutls.a(pkcs11.o):function gnutls_pkcs11_token_get_info: error: undefined reference to 'p11_kit_uri_free'
/usr/lib/i386-linux-gnu/libgnutls.a(pkcs11.o):function pkcs11_login: error: undefined reference to 'p11_kit_uri_new'
/usr/lib/i386-linux-gnu/libgnutls.a(pkcs11.o):function pkcs11_login: error: undefined reference to 'p11_kit_pin_request'
/usr/lib/i386-linux-gnu/libgnutls.a(pkcs11.o):function pkcs11_login: error: undefined reference to 'p11_kit_pin_get_length'
/usr/lib/i386-linux-gnu/libgnutls.a(pkcs11.o):function pkcs11_login: error: undefined reference to 'p11_kit_pin_get_value'
/usr/lib/i386-linux-gnu/libgnutls.a(pkcs11.o):function pkcs11_login: error: undefined reference to 'p11_kit_pin_unref'
/usr/lib/i386-linux-gnu/libgnutls.a(pkcs11.o):function pkcs11_login: error: undefined reference to 'p11_kit_uri_get_pinfile'
/usr/lib/i386-linux-gnu/libgnutls.a(pkcs11.o):function pkcs11_login: error: undefined reference to 'p11_kit_space_strdup'
/usr/lib/i386-linux-gnu/libgnutls.a(pkcs11.o):function pkcs11_login: error: undefined reference to 'p11_kit_space_strdup'
/usr/lib/i386-linux-gnu/libgnutls.a(pkcs11.o):function pkcs11_login: error: undefined reference to 'p11_kit_uri_new'
/usr/lib/i386-linux-gnu/libgnutls.a(pkcs11.o):function pkcs11_login: error: undefined reference to 'p11_kit_pin_new_for_string'
/usr/lib/i386-linux-gnu/libgnutls.a(pkcs11.o):function pkcs11_find_object: error: undefined reference to 'p11_kit_uri_get_attributes'
/usr/lib/i386-linux-gnu/libgnutls.a(pkcs11.o):function pkcs11_call_token_func: error: undefined reference to 'p11_kit_space_strdup'
/usr/lib/i386-linux-gnu/libgnutls.a(pkcs11.o):function pkcs11_strerror: error: undefined reference to 'p11_kit_strerror'
/usr/lib/i386-linux-gnu/libgnutls.a(common.o):function _gnutls_x509_oid_data2string: error: undefined reference to 'asn1_der_decoding'
/usr/lib/i386-linux-gnu/libgnutls.a(common.o):function _gnutls_x509_oid_data2string: error: undefined reference to 'asn1_read_value'
/usr/lib/i386-linux-gnu/libgnutls.a(common.o):function _gnutls_x509_oid_data2string: error: undefined reference to 'asn1_read_value'
/usr/lib/i386-linux-gnu/libgnutls.a(common.o):function _gnutls_x509_get_signed_data: error: undefined reference to 'asn1_der_decoding_startEnd'
/usr/lib/i386-linux-gnu/libgnutls.a(crl.o):function gnutls_x509_crl_get_crt_count: error: undefined reference to 'asn1_number_of_elements'
/usr/lib/i386-linux-gnu/libgnutls.a(crl.o):function gnutls_x509_crl_get_raw_issuer_dn: error: undefined reference to 'asn1_der_decoding_startEnd'
/usr/lib/i386-linux-gnu/libgnutls.a(pkcs12.o):function _pkcs12_decode_safe_contents: error: undefined reference to 'asn1_number_of_elements'
/usr/lib/i386-linux-gnu/libgnutls.a(pkcs12.o):function _pkcs12_decode_safe_contents: error: undefined reference to 'asn1_number_of_elements'
/usr/lib/i386-linux-gnu/libgnutls.a(privkey_pkcs8.o):function read_pkcs_schema_params: error: undefined reference to 'asn1_der_decoding_startEnd'
/usr/lib/i386-linux-gnu/libgnutls.a(x509.o):function gnutls_x509_crt_get_subject: error: undefined reference to 'asn1_find_node'
/usr/lib/i386-linux-gnu/libgnutls.a(x509.o):function gnutls_x509_crt_get_issuer: error: undefined reference to 'asn1_find_node'
/usr/lib/i386-linux-gnu/libgnutls.a(x509.o):function gnutls_x509_dn_get_rdn_ava: error: undefined reference to 'asn1_find_node'
/usr/lib/i386-linux-gnu/libgnutls.a(x509.o):function gnutls_x509_dn_get_rdn_ava: error: undefined reference to 'asn1_find_node'
/usr/lib/i386-linux-gnu/libgnutls.a(x509.o):function gnutls_x509_dn_get_rdn_ava: error: undefined reference to 'asn1_get_length_der'
/usr/lib/i386-linux-gnu/libgnutls.a(x509.o):function gnutls_x509_dn_get_rdn_ava: error: undefined reference to 'asn1_get_tag_der'
/usr/lib/i386-linux-gnu/libgnutls.a(x509.o):function gnutls_x509_dn_get_rdn_ava: error: undefined reference to 'asn1_get_length_der'
/usr/lib/i386-linux-gnu/libgnutls.a(cipher.o):function wrap_gcry_cipher_close: error: undefined reference to 'gcry_cipher_close'
/usr/lib/i386-linux-gnu/libgnutls.a(cipher.o):function wrap_gcry_cipher_setiv: error: undefined reference to 'gcry_cipher_setiv'
/usr/lib/i386-linux-gnu/libgnutls.a(cipher.o):function wrap_gcry_cipher_setkey: error: undefined reference to 'gcry_cipher_setkey'
/usr/lib/i386-linux-gnu/libgnutls.a(cipher.o):function wrap_gcry_cipher_init: error: undefined reference to 'gcry_cipher_open'
/usr/lib/i386-linux-gnu/libgnutls.a(cipher.o):function wrap_gcry_cipher_init: error: undefined reference to 'gcry_cipher_open'
/usr/lib/i386-linux-gnu/libgnutls.a(cipher.o):function wrap_gcry_cipher_init: error: undefined reference to 'gcry_cipher_open'
/usr/lib/i386-linux-gnu/libgnutls.a(cipher.o):function wrap_gcry_cipher_init: error: undefined reference to 'gcry_cipher_open'
/usr/lib/i386-linux-gnu/libgnutls.a(cipher.o):function wrap_gcry_cipher_decrypt: error: undefined reference to 'gcry_cipher_decrypt'
/usr/lib/i386-linux-gnu/libgnutls.a(cipher.o):function wrap_gcry_cipher_encrypt: error: undefined reference to 'gcry_cipher_encrypt'
/usr/lib/i386-linux-gnu/libgnutls.a(init.o):function gnutls_crypto_init: error: undefined reference to 'gcry_control'
/usr/lib/i386-linux-gnu/libgnutls.a(init.o):function gnutls_crypto_init: error: undefined reference to 'gcry_control'
/usr/lib/i386-linux-gnu/libgnutls.a(init.o):function gnutls_crypto_init: error: undefined reference to 'gcry_check_version'
/usr/lib/i386-linux-gnu/libgnutls.a(init.o):function gnutls_crypto_init: error: undefined reference to 'gcry_control'
/usr/lib/i386-linux-gnu/libgnutls.a(init.o):function gnutls_crypto_init: error: undefined reference to 'gcry_control'
/usr/lib/i386-linux-gnu/libgnutls.a(init.o):function gnutls_crypto_init: error: undefined reference to 'gcry_check_version'
/usr/lib/i386-linux-gnu/libgnutls.a(mac.o):function wrap_gcry_md_copy: error: undefined reference to 'gcry_md_copy'
/usr/lib/i386-linux-gnu/libgnutls.a(mac.o):function wrap_gcry_hash_init: error: undefined reference to 'gcry_md_open'
/usr/lib/i386-linux-gnu/libgnutls.a(mac.o):function wrap_gcry_hash_init: error: undefined reference to 'gcry_md_open'
/usr/lib/i386-linux-gnu/libgnutls.a(mac.o):function wrap_gcry_hash_init: error: undefined reference to 'gcry_md_open'
/usr/lib/i386-linux-gnu/libgnutls.a(mac.o):function wrap_gcry_hash_init: error: undefined reference to 'gcry_md_open'
/usr/lib/i386-linux-gnu/libgnutls.a(mac.o):function wrap_gcry_md_close: error: undefined reference to 'gcry_md_close'
/usr/lib/i386-linux-gnu/libgnutls.a(mac.o):function wrap_gcry_md_write: error: undefined reference to 'gcry_md_write'
/usr/lib/i386-linux-gnu/libgnutls.a(mac.o):function wrap_gcry_md_setkey: error: undefined reference to 'gcry_md_setkey'
/usr/lib/i386-linux-gnu/libgnutls.a(mac.o):function wrap_gcry_mac_output: error: undefined reference to 'gcry_md_read'
/usr/lib/i386-linux-gnu/libgnutls.a(mac.o):function wrap_gcry_mac_output: error: undefined reference to 'gcry_md_get_algo'
/usr/lib/i386-linux-gnu/libgnutls.a(mac.o):function wrap_gcry_mac_output: error: undefined reference to 'gcry_md_get_algo_dlen'
/usr/lib/i386-linux-gnu/libgnutls.a(lt3-mpi.o):function wrap_gcry_mpi_print: error: undefined reference to 'gcry_mpi_print'
/usr/lib/i386-linux-gnu/libgnutls.a(lt3-mpi.o):function wrap_gcry_mpi_scan: error: undefined reference to 'gcry_mpi_scan'
/usr/lib/i386-linux-gnu/libgnutls.a(lt3-mpi.o):function wrap_gcry_mpi_release: error: undefined reference to 'gcry_mpi_release'
/usr/lib/i386-linux-gnu/libgnutls.a(lt3-mpi.o):function wrap_gcry_prime_check: error: undefined reference to 'gcry_prime_check'
/usr/lib/i386-linux-gnu/libgnutls.a(lt3-mpi.o):function wrap_gcry_generate_group: error: undefined reference to 'gcry_prime_generate'
/usr/lib/i386-linux-gnu/libgnutls.a(lt3-mpi.o):function wrap_gcry_generate_group: error: undefined reference to 'gcry_prime_check'
/usr/lib/i386-linux-gnu/libgnutls.a(lt3-mpi.o):function wrap_gcry_generate_group: error: undefined reference to 'gcry_mpi_release'
/usr/lib/i386-linux-gnu/libgnutls.a(lt3-mpi.o):function wrap_gcry_generate_group: error: undefined reference to 'gcry_prime_release_factors'
/usr/lib/i386-linux-gnu/libgnutls.a(lt3-mpi.o):function wrap_gcry_generate_group: error: undefined reference to 'gcry_prime_group_generator'
/usr/lib/i386-linux-gnu/libgnutls.a(lt3-mpi.o):function wrap_gcry_generate_group: error: undefined reference to 'gcry_prime_release_factors'
/usr/lib/i386-linux-gnu/libgnutls.a(lt3-mpi.o):function wrap_gcry_generate_group: error: undefined reference to 'gcry_mpi_release'
/usr/lib/i386-linux-gnu/libgnutls.a(lt3-mpi.o):function wrap_gcry_generate_group: error: undefined reference to 'gcry_prime_release_factors'
/usr/lib/i386-linux-gnu/libgnutls.a(lt3-mpi.o):function wrap_gcry_generate_group: error: undefined reference to 'gcry_mpi_release'
/usr/lib/i386-linux-gnu/libgnutls.a(lt3-mpi.o):function wrap_gcry_mpi_get_nbits: error: undefined reference to 'gcry_mpi_get_nbits'
/usr/lib/i386-linux-gnu/libgnutls.a(lt3-mpi.o):function wrap_gcry_mpi_new: error: undefined reference to 'gcry_mpi_new'
/usr/lib/i386-linux-gnu/libgnutls.a(lt3-mpi.o):function wrap_gcry_mpi_div: error: undefined reference to 'gcry_mpi_div'
/usr/lib/i386-linux-gnu/libgnutls.a(lt3-mpi.o):function wrap_gcry_mpi_div: error: undefined reference to 'gcry_mpi_get_nbits'
/usr/lib/i386-linux-gnu/libgnutls.a(lt3-mpi.o):function wrap_gcry_mpi_div: error: undefined reference to 'gcry_mpi_new'
/usr/lib/i386-linux-gnu/libgnutls.a(lt3-mpi.o):function wrap_gcry_mpi_mul_ui: error: undefined reference to 'gcry_mpi_mul_ui'
/usr/lib/i386-linux-gnu/libgnutls.a(lt3-mpi.o):function wrap_gcry_mpi_mul_ui: error: undefined reference to 'gcry_mpi_get_nbits'
/usr/lib/i386-linux-gnu/libgnutls.a(lt3-mpi.o):function wrap_gcry_mpi_mul_ui: error: undefined reference to 'gcry_mpi_new'
/usr/lib/i386-linux-gnu/libgnutls.a(lt3-mpi.o):function wrap_gcry_mpi_sub_ui: error: undefined reference to 'gcry_mpi_sub_ui'
/usr/lib/i386-linux-gnu/libgnutls.a(lt3-mpi.o):function wrap_gcry_mpi_sub_ui: error: undefined reference to 'gcry_mpi_get_nbits'
/usr/lib/i386-linux-gnu/libgnutls.a(lt3-mpi.o):function wrap_gcry_mpi_sub_ui: error: undefined reference to 'gcry_mpi_new'
/usr/lib/i386-linux-gnu/libgnutls.a(lt3-mpi.o):function wrap_gcry_mpi_add_ui: error: undefined reference to 'gcry_mpi_add_ui'
/usr/lib/i386-linux-gnu/libgnutls.a(lt3-mpi.o):function wrap_gcry_mpi_mul: error: undefined reference to 'gcry_mpi_mul'
/usr/lib/i386-linux-gnu/libgnutls.a(lt3-mpi.o):function wrap_gcry_mpi_sub: error: undefined reference to 'gcry_mpi_sub'
/usr/lib/i386-linux-gnu/libgnutls.a(lt3-mpi.o):function wrap_gcry_mpi_add: error: undefined reference to 'gcry_mpi_add'
/usr/lib/i386-linux-gnu/libgnutls.a(lt3-mpi.o):function wrap_gcry_mpi_mulm: error: undefined reference to 'gcry_mpi_mulm'
/usr/lib/i386-linux-gnu/libgnutls.a(lt3-mpi.o):function wrap_gcry_mpi_subm: error: undefined reference to 'gcry_mpi_subm'
/usr/lib/i386-linux-gnu/libgnutls.a(lt3-mpi.o):function wrap_gcry_mpi_addm: error: undefined reference to 'gcry_mpi_addm'
/usr/lib/i386-linux-gnu/libgnutls.a(lt3-mpi.o):function wrap_gcry_mpi_powm: error: undefined reference to 'gcry_mpi_powm'
/usr/lib/i386-linux-gnu/libgnutls.a(lt3-mpi.o):function wrap_gcry_mpi_set_ui: error: undefined reference to 'gcry_mpi_set_ui'
/usr/lib/i386-linux-gnu/libgnutls.a(lt3-mpi.o):function wrap_gcry_mpi_set: error: undefined reference to 'gcry_mpi_set'
/usr/lib/i386-linux-gnu/libgnutls.a(lt3-mpi.o):function wrap_gcry_mpi_mod: error: undefined reference to 'gcry_mpi_mod'
/usr/lib/i386-linux-gnu/libgnutls.a(lt3-mpi.o):function wrap_gcry_mpi_cmp_ui: error: undefined reference to 'gcry_mpi_cmp_ui'
/usr/lib/i386-linux-gnu/libgnutls.a(lt3-mpi.o):function wrap_gcry_mpi_cmp: error: undefined reference to 'gcry_mpi_cmp'
/usr/lib/i386-linux-gnu/libgnutls.a(pk.o):function _wrap_gcry_pk_verify: error: undefined reference to 'gcry_sexp_release'
/usr/lib/i386-linux-gnu/libgnutls.a(pk.o):function _wrap_gcry_pk_verify: error: undefined reference to 'gcry_sexp_release'
/usr/lib/i386-linux-gnu/libgnutls.a(pk.o):function _wrap_gcry_pk_verify: error: undefined reference to 'gcry_sexp_release'
/usr/lib/i386-linux-gnu/libgnutls.a(pk.o):function _wrap_gcry_pk_verify: error: undefined reference to 'gcry_sexp_build'
/usr/lib/i386-linux-gnu/libgnutls.a(pk.o):function _wrap_gcry_pk_verify: error: undefined reference to 'gcry_sexp_build'
/usr/lib/i386-linux-gnu/libgnutls.a(pk.o):function _wrap_gcry_pk_verify: error: undefined reference to 'gcry_sexp_build'
/usr/lib/i386-linux-gnu/libgnutls.a(pk.o):function _wrap_gcry_pk_verify: error: undefined reference to 'gcry_sexp_build'
/usr/lib/i386-linux-gnu/libgnutls.a(pk.o):function _wrap_gcry_pk_verify: error: undefined reference to 'gcry_pk_verify'
/usr/lib/i386-linux-gnu/libgnutls.a(pk.o):function _wrap_gcry_pk_sign: error: undefined reference to 'gcry_sexp_release'
/usr/lib/i386-linux-gnu/libgnutls.a(pk.o):function _wrap_gcry_pk_sign: error: undefined reference to 'gcry_pk_sign'
/usr/lib/i386-linux-gnu/libgnutls.a(pk.o):function _wrap_gcry_pk_sign: error: undefined reference to 'gcry_sexp_find_token'
/usr/lib/i386-linux-gnu/libgnutls.a(pk.o):function _wrap_gcry_pk_sign: error: undefined reference to 'gcry_sexp_nth_mpi'
/usr/lib/i386-linux-gnu/libgnutls.a(pk.o):function _wrap_gcry_pk_sign: error: undefined reference to 'gcry_sexp_find_token'
/usr/lib/i386-linux-gnu/libgnutls.a(pk.o):function _wrap_gcry_pk_sign: error: undefined reference to 'gcry_sexp_nth_mpi'
/usr/lib/i386-linux-gnu/libgnutls.a(pk.o):function _wrap_gcry_pk_sign: error: undefined reference to 'gcry_sexp_find_token'
/usr/lib/i386-linux-gnu/libgnutls.a(pk.o):function _wrap_gcry_pk_sign: error: undefined reference to 'gcry_sexp_nth_mpi'
/usr/lib/i386-linux-gnu/libgnutls.a(pk.o):function _wrap_gcry_pk_decrypt: error: undefined reference to 'gcry_pk_decrypt'
/usr/lib/i386-linux-gnu/libgnutls.a(pk.o):function _wrap_gcry_pk_decrypt: error: undefined reference to 'gcry_sexp_nth_mpi'
/usr/lib/i386-linux-gnu/libgnutls.a(pk.o):function _wrap_gcry_pk_encrypt: error: undefined reference to 'gcry_pk_encrypt'
/usr/lib/i386-linux-gnu/libgnutls.a(pk.o):function _wrap_gcry_pk_encrypt: error: undefined reference to 'gcry_sexp_find_token'
/usr/lib/i386-linux-gnu/libgnutls.a(pk.o):function wrap_gcry_pk_fixup: error: undefined reference to 'gcry_mpi_invm'
/usr/lib/i386-linux-gnu/libgnutls.a(pk.o):function wrap_gcry_pk_fixup: error: undefined reference to 'gcry_mpi_invm'
/usr/lib/i386-linux-gnu/libgnutls.a(pk.o):function wrap_gcry_pk_generate_params: error: undefined reference to 'gcry_check_version'
/usr/lib/i386-linux-gnu/libgnutls.a(pk.o):function wrap_gcry_pk_generate_params: error: undefined reference to 'gcry_pk_genkey'
/usr/lib/i386-linux-gnu/libgnutls.a(pk.o):function wrap_gcry_pk_generate_params: error: undefined reference to 'gcry_pk_genkey'
/usr/lib/i386-linux-gnu/libgnutls.a(rnd.o):function wrap_gcry_rnd: error: undefined reference to 'gcry_randomize'
/usr/lib/i386-linux-gnu/libgnutls.a(rnd.o):function wrap_gcry_rnd: error: undefined reference to 'gcry_create_nonce'
/usr/lib/i386-linux-gnu/libgnutls.a(rnd.o):function wrap_gcry_rnd_init: error: undefined reference to 'gcry_create_nonce'
/usr/lib/i386-linux-gnu/libgnutls.a(rnd.o):function wrap_gcry_rnd_init: error: undefined reference to 'gcry_randomize'
/usr/lib/i386-linux-gnu/libgnutls.a(sign.o):function _gnutls_x509_pkix_sign: error: undefined reference to 'asn1_copy_node'
/usr/lib/i386-linux-gnu/libsqlite3.a(sqlite3.o):function unixDlOpen: warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/i386-linux-gnu/libxml2.a(nanohttp.o):function xmlNanoHTTPConnectHost: warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/i386-linux-gnu/libxml2.a(nanohttp.o):function xmlNanoHTTPConnectHost: warning: Using 'gethostbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/i386-linux-gnu/libxml2.a(nanoftp.o):function xmlNanoFTPConnect: warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/i386-linux-gnu/libxml2.a(nanoftp.o):function xmlNanoFTPConnect: warning: Using 'gethostbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/i386-linux-gnu/libxml2.a(nanoftp.o):function xmlNanoFTPConnect: warning: Using 'gethostbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/i386-linux-gnu/libxml2.a(nanoftp.o):function xmlNanoFTPConnect: warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
collect2: ld returned 1 exit status
make[2]: *** [aria2c] Error 1
make[2]: Leaving directory /home/johny/Downloads/aria2/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory/home/johny/Downloads/aria2'
make: *** [all] Error 2

damaged download if 'WrDiskCacheEntry is not empty' occured

It does not alway occured, but if something just like this:

04/23 11:26:46 [WARN] WrDiskCacheEntry is not empty size=16103

in http(s) download, the file seems damaged after download complete.
It seems only appear when --disk-cache has a non-zero value, and --file-allocation is falloc or trunc (I've not try other value).

using aira2c from latest master branch.
Enabled Features: Async DNS, BitTorrent, Firefox3 Cookie, GZip, HTTPS, Message Digest, Metalink, XML-RPC
Hash Algorithms: sha-1, sha-224, sha-256, sha-384, sha-512, md5
Libraries: zlib/1.2.7 libxml2/2.8.0 sqlite3/3.7.16.1 GnuTLS/3.1.10 nettle GMP/5.0.5 c-ares/1.9.1
on Debian 3.2.41-2 x86_64 GNU/Linux.

Wrong download percentage

When I hit CTRL-C, aria2 shows me the download percentage for every single file. But in some of them, the percentage numbers are not right, e.g. 566, -310 etc.. Here is the download log:

[#1 SIZE:7,197.2MiB/15,986.2MiB(45%) CN:0 SEED:0 SPD:0Bs]^C
2012-12-15 14:40:44.402600 NOTICE - Shutdown sequence commencing... Press Ctrl-C again for emergency shutdown.

2012-12-15 14:40:44.403945 NOTICE - Download GID#1 not complete: /home/kx/Desktop/Show

Download Results:
gid|stat|avg speed  |  %|path/URI
===+====+===========+===+=======================================================
  1|INPR|       0B/s| 62|/home/kx/Desktop/Show/Episode_14.mkv
   |    |           | 54|/home/kx/Desktop/Show/Episode_12.mkv
   |    |           | 57|/home/kx/Desktop/Show/Episode_09.mkv
   |    |           | 59|/home/kx/Desktop/Show/Episode_19.mkv
   |    |           | 42|/home/kx/Desktop/Show/Episode_24.mkv
   |    |           | 27|/home/kx/Desktop/Show/Episode_07.mkv
   |    |           | 56|/home/kx/Desktop/Show/Episode_16.mkv
   |    |           |652|/home/kx/Desktop/Show/Episode_17.mkv
   |    |           |-566|/home/kx/Desktop/Show/Episode_06.mkv
   |    |           | 32|/home/kx/Desktop/Show/Episode_01.mkv
   |    |           | 49|/home/kx/Desktop/Show/Episode_18.mkv
   |    |           | 31|/home/kx/Desktop/Show/Episode_05.mkv
   |    |           | 34|/home/kx/Desktop/Show/Episode_03.mkv
   |    |           | 42|/home/kx/Desktop/Show/Episode_20.mkv
   |    |           | 35|/home/kx/Desktop/Show/Episode_22.mkv
   |    |           | 44|/home/kx/Desktop/Show/Episode_21.mkv
   |    |           | 52|/home/kx/Desktop/Show/Episode_13.mkv
   |    |           | 61|/home/kx/Desktop/Show/Episode_10.mkv
   |    |           | 61|/home/kx/Desktop/Show/Episode_11.mkv
   |    |           | 35|/home/kx/Desktop/Show/Episode_02.mkv
   |    |           | 54|/home/kx/Desktop/Show/Episode_15.mkv
   |    |           | 27|/home/kx/Desktop/Show/Episode_08.mkv
   |    |           | 35|/home/kx/Desktop/Show/Episode_23.mkv
   |    |           | 28|/home/kx/Desktop/Show/Episode_04.mkv
   |    |           |  0|/home/kx/Desktop/Show/Information.txt

Status Legend:
(INPR):download in-progress.

aria2 will resume download if the transfer is restarted.
If there are any errors, then see the log file. See '-l' option in help/man page for details.

This is not a particular case, it happened to me at other times too.

P.S.: I'm sorry for my english.

Overall download limit does not work as far as I can tell

First things first, I'm calculating downspeed using

def downspeed
  aria2_client.tell_active.inject(0) do |sum, download|
    sum += Integer(download["downloadSpeed"])
  end
end

Sampling this 10 times with 5s pause I get

[461418, 463992, 468939, 472702, 475559, 470763, 478367, 476623, 471814, 472302].
  instance_eval { reduce(:+) / size.to_f } # => 471247.9

This is an average of 460 kilobytes. Currently there is no limit set and 460 kb is roughly my line limit. So things are working as expected. Theoretically, I should be able to halve this speed to roughly 200 kilobytes by issuing:

a.global_opts["max-overall-download-limit"] # => "0"
a.change_global_opt("max-overall-download-limit", "200K") # => "OK"
a.global_opts["max-overall-download-limit"] => "204800"

After 1 minute and 5 minutes I get the following samplings:

[787563, 687335, 737474, 616957, 379094, 261147, 762531, 712533, 713150, 528384] 
 # => avg: 618616.8
[241659, 295719, 204817, 291366, 306119, 229627, 515800, 438093, 409138, 354970]
 # => avg: 328730.8

This just seems broken to me because both average above the limit I set for aria. Furthermore, I've used out-of-band monitoring tools like the iftop command to see what the actual bandwidth consumption is. In both cases, it hovers around 460 kb which is my line speed.

It is worth noting that if I seriously restrict the usage (10K) then aria does actually limit it - but not to 10K!

[116286, 104248, 107772, 115253, 84493, 42524, 118660, 105615, 110290, 118871].
  instance_eval { reduce(:+) / size.to_f } # => 102401.2 # 100 K!

I have a couple of questions:

  1. Is my download-speed-measuring function OK? Is there anything I can do to improve it?
  2. Am I doing something stupid with the max-overall-download-limit option?

Some points to note:

  1. All my downloads are added via metalinks: I call addUri with a http://foo.metalink file.
  2. This is on Ubuntu 12.04 using the PPA. Aria is at 1.13.0.

Add optional flag to specify location of the bash_completion folder location

Hi, I'm the current packager for aria2 for archlinux.

The current behavior for autotools is that the bash_completion directory is hardcoded to install to doc_bashcompletiondir = $(docdir)/bash_completion

When installing, it might be convenient for there to be a flag to specify the location of the bash_completion folder to install the "aria2c" completion file.

The flag could be named --bashcompletiondir and if it is unspecified it would default to $(docdir)/bash_completion and would install the files that are currently installed which are "aria2c" and "README.txt". But if the flag is specified, it would only install the "aria2c" file to the location specified by --bashcompletiondir

This would be especially helpful for packagers by providing a clean interface for them to specify a bash_completion location.

For example, the current location to install bash_completions on archlinux is /usr/share/bash-completion/completions
So the flag would work like:
./configure --bashcompletiondir=/usr/share/bash-completion/completions

This is also a lot cleaner than the current method to install the bash_completion after installing aria2:

add bash completion (aria2 automatically installs to a temporary target directory)

install -d ${pkgdir}/usr/share/bash-completion/completions
install -m644 ${pkgdir}/usr/share/doc/aria2/bash_completion/aria2c
${pkgdir}/usr/share/bash-completion/completions
rm -rf ${pkgdir}/usr/share/doc/aria2/bash_completion

UDP tracker support

If there is no explicit reason to not support UDP trackers, it should be implemented sometime.

Buiding failed under centos 5.9

[root@dydev aria2-1.16.5]# autoconf -i
aclocal.m4:21: warning: this file was generated for autoconf 2.69.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically `autoreconf'.
configure.ac:4: error: Autoconf version 2.67 or higher is required
configure.ac:4: the top level
autom4te: /usr/bin/m4 failed with exit status: 63

Building on OpenIndiana

I'm trying to build from master source and am running into autoconf issues on stock OpenIndiana:

$ ~/src/aria2 $ autoconf
configure.ac:4: error: Autoconf version 2.67 or higher is required
configure.ac:4: the top level
autom4te: /usr/sfw/bin/gm4 failed with exit status: 63

It seems the standard system autoconf is 2.63. Any suggestions?

aria2.addTorrent with options failed

Using JSON-RPC, no problem in aria2.addUri with options, but get 500 error in aria2.addTorrent with options.
It works well:

{
    "jsonrpc": "2.0",
    "id": "10",
    "method": "aria2.addUri",
    "params":
    [
        [
            "http://url/to/a.torrent"
        ],
        {
            "pause": "true"
        }
    ]
}

It is alse right:

{
    "jsonrpc": "2.0",
    "id": "11",
    "method": "aria2.addTorrent",
    "params":
    [
        "(base64 of torrent file)"
    ]
}

But it only get a 500 error using urllib2:

{
    "jsonrpc": "2.0",
    "id": "11",
    "method": "aria2.addTorrent",
    "params":
    [
        "(base64 of torrent file)",
        {"pause": "true"}
    ]
}

and, the return from aria2:

{
    "error": {
        "code": 1,
        "message": "The parameter at 1 has wrong type."
    },
    "id": "11",
    "jsonrpc": "2.0"
}

Why it is wrong?

Torrent download >100% complete

STR:

  • Start downloading a torrent with e.g. --select-file=3,11
  • At some point CTRL-C to cleanly shutdown
  • Resume previous download but with narrower --select-file, e.g. --select-file=3
  • Download at one point reaches 100%, but then goes beyond 100% and is not complete: Neither is the download stopped (or put into seeding mode) nor is it actually complete; there are still pieces missing.

Debian x86_64 on squeeze, aria2 1.15.1 self-built deb (official sources from sf.net; gcc 4.4; using debian/ from official squeeze package source, sans patches)

My guess is that while aria2 shows the actual download size requested, it does in fact download all missing pieces from the previous selection instead of just the pieces from the current selection (e.g. pieces for files #3 and #11 instead of just #3).

handshake failure in downloading from https://ftp.mozilla.org/; error download not saved with --save-session

download with command:

aria2c --no-conf "https://ftp.mozilla.org/pub/mozilla.org/firefox/releases/20.0.1/source/firefox-20.0.1.source.tar.bz2"

get error infomation:

05/09 22:17:10 [ERROR] CUID#6 - Download aborted. URI=https://ftp.mozilla.org/pub/mozilla.org/firefox/releases/20.0.1/source/firefox-20.0.1.source.tar.bz2
Exception: [AbstractCommand.cc:314] errorCode=1 URI=https://ftp.mozilla.org/pub/mozilla.org/firefox/releases/20.0.1/source/firefox-20.0.1.source.tar.bz2
  -> [SocketCore.cc:867] errorCode=1 SSL/TLS handshake failure: A record packet with illegal version was received.

download with command:

aria2c --no-conf --save-session download.list "http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/20.0.1/source/firefox-20.0.1.source.tar.bz"

of course get error infomation:

05/09 22:20:58 [ERROR] CUID#6 - Download aborted. URI=http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/20.0.1/source/firefox-20.0.1.source.tar.bz
Exception: [AbstractCommand.cc:314] errorCode=3 URI=http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/20.0.1/source/firefox-20.0.1.source.tar.bz
  -> [HttpSkipResponseCommand.cc:215] errorCode=3 Resource not found

and nothing in download.list at all.

using aira2c from latest master branch.

Enabled Features: Async DNS, BitTorrent, Firefox3 Cookie, GZip, HTTPS, Message Digest, Metalink, XML-RPC
Hash Algorithms: sha-1, sha-224, sha-256, sha-384, sha-512, md5
Libraries: zlib/1.2.8 libxml2/2.8.0 sqlite3/3.7.16.2 GnuTLS/3.1.10 nettle GMP/5.1.1 c-ares/1.9.1

running on Linux 3.8-1-amd64 SMP Debian 3.8.11-1 x86_64 GNU/Linux.

Cookies

Hi,

I'm trying to get aria2c to load chrome's cookie file under ~/Library/Application Support/Google/Chrome/Default/Cookies

It fails (twice); is there any way I can get more info on why it's failing to load the cookies file?

Thanks!

Peer refreshing

Hi,

I found that long running torrents are getting a major drop off speed after, say 10 hours. I'm left with two connections and achieving a low speed. If I pause the job and instantly get it running again, it quickly finds another 44 connections and maxes out my connection (torrent is healthy). Is there an option for updating the tracker in intervals? How can I maintain the speed and accept new connections?

input file with complited downloads

it would be nice to have a flag or option saved/added to input file to tell aria not to retry downloading them again
use case:
input-file=sessionfile
save-session=sessionfile
force-save=true
anew option say iscompete gets the download shown as complete after checking its md5sum if available and let torrents load normally (seed in most cases)

make install problem (ignores destdir?)

make DESTDIR="$pkgdir" install

....
Making install in en
make[3]: Entering directory `/home/pb/aria2-git/src/aria2/doc/manual-src/en'
make[4]: Entering directory `/home/pb/aria2-git/src/aria2/doc/manual-src/en'
make[4]: Nothing to be done for `install-exec-am'.
mkdir -p /usr/share/doc/aria2/manual/en && \
cp -r ../../manual/en/html /usr/share/doc/aria2/manual/en && \
rm -f /usr/share/doc/aria2/manual/en/html/.buildinfo
mkdir: cannot create directory ‘/usr/share/doc/aria2/manual’: Permission denied
make[4]: *** [install-data-local] Error 1
make[4]: Leaving directory `/home/pb/aria2-git/src/aria2/doc/manual-src/en'
make[3]: *** [install-am] Error 2
make[3]: Leaving directory `/home/pb/aria2-git/src/aria2/doc/manual-src/en'
make[2]: *** [install-recursive] Error 1
make[2]: Leaving directory `/home/pb/aria2-git/src/aria2/doc/manual-src'
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory `/home/pb/aria2-git/src/aria2/doc'
make: *** [install-recursive] Error 1

Compiling gcc -Ofast results in segfault (x86_64-mingw-w64?)

When compiling master after all the C++11 stuff with gcc -Ofast, the resulting binary segfaults at some random location. ( -O2 is fine )

$ $CC --version
x86_64-w64-mingw32-gcc (GCC) 4.8.0

Having all the optimizations in there doesn't help getting a stack, obviously. Nor does it help that I have a cross-compile setup instead of a native-native one.
Anyway that the full stack trace (and yes, the binary has full debug symbols):

Program received signal SIGSEGV, Segmentation fault.
0x0000000100000000 in ?? ()
(gdb) bt
#0  0x0000000100000000 in ?? ()
warning: (Internal error: pc 0xeb in read in psymtab, but not in symtab.)

warning: (Internal error: pc 0xeb in read in psymtab, but not in symtab.)

#1  0x00000000000000ec in ?? (warning: (Internal error: pc 0xeb in read in psymtab, but not in symtab.)

) at /usr/local/x86_64-w64-mingw32/include/c++/4.8.0/bits/stl_algobase.h:337
warning: (Internal error: pc 0xeb in read in psymtab, but not in symtab.)

#2  0x000000000032f108 in ?? ()
#3  0x000000000032f168 in ?? ()
#4  0x0000000000000000 in ?? ()

The segfault only happens when you attempt to download something, and only when the download starts, i.e. after all initialization (incl. rpc).

I didn't have the time to look into this or even determine if it is a compiler or a code bug.
Anyway, my hope is that this maybe can be reproduced in a less exotic setting using a native gcc.

Http download error

Log file.
I used aria2 as launch daemons on OS X seem like conflict with DNSCrypt (change DNS to 127.0.0.54) it only happen when aria2 start with system magnet link download fine but not http "sudo launchctl unload" then load aria2 download file with no problem.
2013-04-11 04:44:48.600629 [INFO] [SocketCore.cc:1344] Not considered: fe80::1%lo0
2013-04-11 04:44:48.600648 [INFO] [SocketCore.cc:1344] Not considered: 127.0.0.1
2013-04-11 04:44:48.600664 [INFO] [SocketCore.cc:1344] Not considered: ::1
2013-04-11 04:44:48.600681 [INFO] [SocketCore.cc:1342] Found configured address: 127.0.0.53
2013-04-11 04:44:48.600698 [INFO] [SocketCore.cc:1342] Found configured address: 127.0.0.54
2013-04-11 04:44:48.600715 [INFO] [SocketCore.cc:1342] Found configured address: 127.0.0.55
2013-04-11 04:44:48.600762 [INFO] [SocketCore.cc:1344] Not considered: fe80::129a:ddff:feab:2644%en0
2013-04-11 04:44:48.600779 [INFO] [SocketCore.cc:1342] Found configured address: 192.168.1.2
2013-04-11 04:44:48.600793 [INFO] [SocketCore.cc:1349] IPv4 configured=1, IPv6 configured=0

addTorrent with external hard drive

Procedure:
Download torrent with aria2rpc addTorrent 'torrent' -d 'external hard drive'
Pause it, reboot computer torrent file disappear from aria list:
[ERROR] [download_helper.cc:415] Unrecognized URI or unsupported protocol: /Volumes/My Passport/untitled folder/untitled folder2/6a002c0f0d00808dab5b5bcfe40800cace6b945e.torrent
aria2 running as deamon.

something wrong when i buiding on xubuntu 12

Hi, tatsuhiro
i want to budild aria2-1.16.1 in my xubuntu-12.04.1-desktop-i386 system. xubuntu have run "2. sudo apt-get install autoconf automake libcppunit-dev autopoint openssl libtool sphinx-common sphinxsearch libgcrypt11-dev libxml2-dev pkg-config" before i build.
I download aria2-master.zip from your web ,then i relase aria2-master.zip in xubuntu. after that i run the below command
mv aria2-master aria2-1.16.1
cd aria2-1.16.1
autoreconf –i
"autoreconf -i" show the below wrong infromation:
autoreconf: configure.ac' orconfigure.in' is required

would you please advise me how to deal with this?
i want to add the newest aria2 to openwrt which i buid on xubuntu 12.04?
many thanks.

"Too large size" on Android build

hi, i built aria2 on an Android device. But when I download a torrent file which include a file is larger than 4G, aria2 report "Too large size".
I think the reason is that off_t is 32bit on android, and in source file bittorrent_helper.cc:254
if(fileLengthData->i() > std::numeric_limits<off_t>::max()) {
throw DOWNLOAD_FAILURE_EXCEPTION(fmt(EX_TOO_LARGE_FILE, length));

Should i hack std:numeric_limits<offt_t> to numeric_limits<int64_t>?

Memory usage control

Bt prolonged use will continue to take up memory space, how to control memory usage?

Option to download .torrent without downloading the files in the torrent

There doesn't seem to be an option to download the .torrent file without downloading the files in the torrent. The only option I could find is in a build configuration.
I don't use aria2 as a torrent client, but I need to download the raw .torrent files so I could process them, or send them to other torrent clients, so this option would be very convenient.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.