Commit Graph

3382 Commits (9b41970134706f598ede204502bbd196eeedb26c)

Author SHA1 Message Date
Tatsuhiro Tsujikawa 8ba9b04747 Cleanup for defines 2015-06-21 17:42:27 +09:00
Tatsuhiro Tsujikawa f5ff5da9da Use constexpr for macros defined in BtConstants.h 2015-06-21 17:33:23 +09:00
Tatsuhiro Tsujikawa 95f2c00c71 Remove unused macros defined in util.h 2015-06-21 17:17:40 +09:00
Tatsuhiro Tsujikawa 7b3f94145d Make constexpr macros in DHTConstant.h 2015-06-21 17:05:02 +09:00
Tatsuhiro Tsujikawa 0b48bb1dbd Use user-defined literals for time units 2015-06-21 15:30:02 +09:00
Tatsuhiro Tsujikawa dd277b33af gnutls: Allow SIGN-RSA-SHA1 for compatibility reason 2015-06-21 15:16:15 +09:00
Tatsuhiro Tsujikawa 377eb0699f Use std::begin and std::end 2015-06-11 23:51:41 +09:00
Tatsuhiro Tsujikawa 37c2edd97a Use std::shuffle, instead of std::random_shuffle 2015-06-11 22:40:56 +09:00
Tatsuhiro Tsujikawa 8448b5062f Use std::begin and std::end 2015-06-11 21:37:00 +09:00
Tatsuhiro Tsujikawa 2bbec1086d Use std::make_shared 2015-06-11 21:25:19 +09:00
Tatsuhiro Tsujikawa ce89e26e55 Remove clock_gettime detection and its replacements 2015-06-09 03:45:40 +09:00
Tatsuhiro Tsujikawa 826c239ed2 Fix compiler warning on 32 bit platform 2015-06-09 03:24:14 +09:00
Tatsuhiro Tsujikawa b0f440e631 Rewrite Time with chrono 2015-06-09 03:15:10 +09:00
Tatsuhiro Tsujikawa 99cd73c092 Replace timer facility with chrono lib 2015-06-09 02:05:34 +09:00
Vasilij Schneidermann 8bc1d37b3a Make config and cache files conform to XDG
See http://standards.freedesktop.org/basedir-spec/latest/ for further
details.  This implementation decides the default based on whether a
file exists at the legacy location, if it doesn't, it picks the
XDG-conforming location instead.
2015-06-02 15:54:27 +02:00
Tatsuhiro Tsujikawa bb8df11d7e ftp, sftp: Fix heap-after-free bug on exception 2015-05-28 22:15:25 +09:00
Tatsuhiro Tsujikawa 70541498d8 ftp: Fix timeout when reusing FTP connection 2015-05-28 22:14:43 +09:00
Tatsuhiro Tsujikawa e30becdbed Fix uninitialized field bug in WebSocketSession 2015-05-23 21:17:47 +09:00
Tatsuhiro Tsujikawa fa3401dcb2 Update copyright year in -v output 2015-05-21 00:52:49 +09:00
Tatsuhiro Tsujikawa ee12923122 Arrange #ifdef guard so that formatter does not get fooled 2015-05-16 20:58:51 +09:00
Tatsuhiro Tsujikawa c26da09687 Add --ssh-host-key-md option
Set checksum for SSH host public key.  Use same syntax with --checksum
option.  TYPE is hash type.  The supported hash type is sha-1 or
md5. DIGEST is hex digest.  For example:
sha-1=b030503d4de4539dc7885e6f0f5e256704edf4c3.  This option can be
used to validate server's public key when SFTP is used.  If this
option is not set, which is default, no validation takes place.
2015-05-16 19:43:11 +09:00
Ryan Steinmetz ceee04cfe8 Allow netrc-path to be specified in the config file 2015-05-14 21:20:11 +09:00
multisnow e84176d1f0 fix build error without libssh2 2015-05-14 08:44:17 +08:00
Tatsuhiro Tsujikawa 3855205026 Exit with 32 status code if checksum verification failed 2015-05-12 23:08:10 +09:00
Tatsuhiro Tsujikawa 62826d691d ftp: Fix accessing first element in empty segments vector 2015-05-12 22:42:26 +09:00
Tatsuhiro Tsujikawa 5723f4211a sftp: Seek to the correct position to resume, fix slow start of transfer 2015-05-12 22:31:14 +09:00
Tatsuhiro Tsujikawa 2758fba10c sftp: Add SFTP and libssh2 to feature summary, and add tests 2015-05-12 00:52:50 +09:00
Tatsuhiro Tsujikawa 46595e77d7 sftp: Guard sftp code with HAVE_LIBSSH2 2015-05-12 00:37:21 +09:00
Tatsuhiro Tsujikawa 21c328fc11 sftp: Make sftp works through HTTP proxy 2015-05-12 00:32:30 +09:00
Tatsuhiro Tsujikawa d0ad7033c3 sftp: basic download works
This commits implements basic downloading feature for sftp URI.  This
includes segmented downloads, and connection (sftp session) pooling.
Download via HTTP proxy has not been implemented yet.
2015-05-12 00:31:57 +09:00
Tatsuhiro Tsujikawa 82ba003209 Add basic ssh/sftp code to SocketCore and introduce SSHSession
We use libssh2 to implement sftp feature.  SSHSession is closely
designed to TLSSession, but it differs in several aspects.  In this
code, we only implements read part of sftp, since aria2 won't offer
uploading feature.  Adding SSH/sftp to SocketCore is a bit bloat.  But
by doing this we can reuse DownloadCommand, without mostly no
modification.  We can just create SSHDownloadCommand by inheriting it,
just like existing ftp.
2015-05-10 00:00:23 +09:00
Tatsuhiro Tsujikawa 0ab23e7a8d Document --multiple-interface option
Thic commit documents --multiple-interface option, and move option
handler for it to the place alphabetical order as we do usually
2015-04-22 22:48:49 +09:00
Tatsuhiro Tsujikawa 45199d3691 Merge branch 'master' of https://github.com/sarim/aria2 into sarim-master 2015-04-22 00:08:57 +09:00
Sarim Khan 34d773a465 multiple interface support for link aggregation
fix: wrong variable
2015-04-21 20:59:38 +06:00
Tatsuhiro Tsujikawa 692a674fe0 SocketRecvBuffer: Eliminate memmove
Since we don't try to read into buffer if buffer is not empty, we
don't have to memmove things.  This commit mostly rewrites
SocketRecvBuffer.
2015-04-14 00:25:23 +09:00
David Macek 20a04c1b8d Fix linking with libintl on MinGW-w64 2015-04-03 00:40:06 +02:00
Tatsuhiro Tsujikawa 8ed8ac0fe8 Remove extra space between # and define
Fixes GH-356
2015-03-23 23:38:31 +09:00
Tatsuhiro Tsujikawa d03c7b32c6 Refactor MultiDiskAdaptor::closeFile() and add assert for debugging 2015-03-22 18:38:50 +09:00
Tatsuhiro Tsujikawa b324be70ad Run on-bt-download-complete command when -V reports download finished
See GH-355
2015-03-22 17:58:13 +09:00
Tatsuhiro Tsujikawa 7f9bb0e2da Use dedicated DiskWriter in MultiDiskFileAllocationIterator
We have to use dedicated DiskWriter instead of
(*entryItr_)->getDiskWriter().  This is because
SingleFileAllocationIterator cannot reopen file if file is closed by
OpenedFileCounter.
2015-03-22 01:32:38 +09:00
Nils Maier c248d456d1 Comment getrandom code a bit 2015-03-18 01:46:26 +01:00
Nils Maier ee63dff225 Fix getrandom for system with libc not including errno or systems
not supporting ENOSYS in the first place.

Fixes GH-347
2015-03-18 01:46:21 +01:00
Tatsuhiro Tsujikawa c17b98a9fc Don't send back rpc-secret option value in aria2.getGlobalOption RPC method 2015-03-13 01:09:01 +09:00
Tatsuhiro Tsujikawa 762ab15450 Avoid copy 2015-03-13 00:18:14 +09:00
Tatsuhiro Tsujikawa cb5ccf6a7a SocketBuffer: Keep sending until blocked
See GH-345
2015-03-08 21:15:12 +09:00
Tatsuhiro Tsujikawa 649c49dcc6 Mingw: Use _wgetenv to get user's home directory
Fixes GH-342
2015-02-21 01:49:07 +09:00
Nils Maier ba0e32abae Handle linux getrandom returning EINTR on interrupts/signals
Also handle ENOTSUP failures where aria2 was build with linux headers
newer than the actual running kernel.

Fixes GH-336
2015-02-07 17:18:45 +01:00
Tatsuhiro Tsujikawa 9d577b0ad7 Fix adjustAnnounceUri parameter is not passed 2015-02-07 00:39:33 +09:00
Tatsuhiro Tsujikawa 4cf0bb742f Shuffle web-seeding URIs 2015-02-07 00:38:03 +09:00
Tatsuhiro Tsujikawa e1739c8ee7 Fix compile error without SSL/TLS enabled 2015-02-01 21:32:47 +09:00
Tatsuhiro Tsujikawa d5d21d20d7 Support HTTP date ending "+0000" as well as "GMT". 2015-01-26 21:31:47 +09:00
Nils Maier 81bdd5f61a Revise getRandom facilities
Use one of the following to provide random bytes:
- Windows CryptGenRandom
- Linux getrandom (syscall interface to urandom, without nasty corner
  cases such as file descriptor exhaustion or re-linked /dev/urandom)
- std::device_random (C++ random device, which usually will be urandom)

This also equalizes util::getRandom and SimpleRandomizer (the former
will now use the latter) instead of having essentially two different
PRNG interfaces with potentially different quality.

Closes GH-320
2015-01-20 22:37:24 +01:00
Tatsuhiro Tsujikawa bec6461262 Merge branch 'comments' of https://github.com/dfandrich/aria2 into dfandrich-comments 2015-01-16 21:36:22 +09:00
Dan Fandrich 0538aa40da Fixed some typos in code comments 2015-01-16 01:17:35 +01:00
Dan Fandrich 8c53e37c21 Added debug log of all Metalink URLs with final priorities 2015-01-16 00:29:17 +01:00
Tatsuhiro Tsujikawa d0c20e158e Fix typo 2015-01-13 23:41:59 +09:00
Tatsuhiro Tsujikawa 9f4e76d1b7 Fix indentation in usage output 2015-01-12 17:49:45 +09:00
Tatsuhiro Tsujikawa c653c72dc8 Add --bt-force-encryption option
This option requires BitTorrent message payload encryption with
arc4. This is a shorthand of --bt-requre-crypto
--bt-min-crypto-level=arc4.  If true is given, deny legacy BitTorrent
handshake and only use Obfuscation handshake and always encrypt
message payload. This option defaults to false.
2015-01-12 17:46:20 +09:00
Nils Maier 0895008e5c Fix SSLv3 warnings being issued on connection reuse.
And also improve tlsHandshake code a bit in the process, mostly by being
more explicit about error conditions.
2014-12-30 22:36:24 +01:00
Nils Maier 590aa21c68 Add backward-compatible libuv defs 2014-12-30 22:36:24 +01:00
Nils Maier e0812d5ad1 Fix another printf related warning 2014-12-29 03:15:50 +01:00
Tatsuhiro Tsujikawa ff2a630efe GNUTLS: Remove ifdef for GNUTLS_TLS* since they are not macros
Since they are not macros, we get always TLS_PROTO_NONE (otherwise you
are using SSLv3 and you will get warning nonetheless) and get warning.
2014-12-26 18:08:41 +09:00
Tatsuhiro Tsujikawa d755df2505 TLS: Fix memory leak with OpenSSL
Based on the patch submitted by midnight2k
2014-12-26 18:04:50 +09:00
Tatsuhiro Tsujikawa 701e5df790 Merge branch 'master' into warn-ssl3 2014-12-15 23:44:41 +09:00
Nils Maier 48bcb47a30 Refine messages to include peer info 2014-12-14 10:34:09 +01:00
Nils Maier 3c8704178a Move warn logic into SocketCore
Also fiddle a bit with the WinTLS implementation, forcing "strong"
crypto only for > SSLv3.
2014-12-14 10:34:09 +01:00
Nils Maier b0cdbfe9e7 Fix ASYNC_DNS code in LibuvEventPoll 2014-12-13 08:14:07 +01:00
Nils Maier c5c38bf3a4 Warn about insecure SSL connections.
Fixed GH-313
2014-12-12 18:24:19 +01:00
Nils Maier 811c0f758d Port poll changes to LibuvEventPoll 2014-12-12 12:21:39 +01:00
Nils Maier 6f9ea555c2 Fix compiler warning 2014-12-12 10:34:53 +01:00
Nils Maier 46aa2f6af3 Fix AppleTLSContext protocol selection 2014-12-12 09:29:33 +01:00
Nils Maier 0e5ed611d1 AppleTLS: Set error state when handshake fails...
+ some minor formatting issues.
2014-12-11 12:12:04 +01:00
Tatsuhiro Tsujikawa 73d752fb1c Add --min-tls-version option
The --min-tls-version option specifies minimum SSL/TLS version to
enable. Possible Values: SSLv3, TLSv1, TLSv1.1, TLSv1.2 Default: TLSv1
2014-12-06 17:50:35 +09:00
Tatsuhiro Tsujikawa 62fba76666 Compile with old OpenSSL 2014-12-05 22:43:16 +09:00
Tatsuhiro Tsujikawa 6d3bd60905 LibgnuTLSSession: Disable SSLv3 2014-11-29 20:00:46 +09:00
Tatsuhiro Tsujikawa 71d8424318 LibsslTLSContext: Disable SSLv3 and enable ECDHE cipher suites 2014-11-29 19:33:50 +09:00
Tatsuhiro Tsujikawa bb6fae2f00 LibsslTLSSession: Strict clean shutdown detection 2014-11-14 21:46:06 +09:00
Tatsuhiro Tsujikawa 2cec9df2a2 Fix crash when JSON batch response vector is empty 2014-10-16 22:56:23 +09:00
Tatsuhiro Tsujikawa f72a303b8d Add --bt-detach-seed-only option
This option excludes seed only downloads when counting concurrent
active downloads (-j option).  This means that if -j3 is given and
this option is turned on and 3 downloads are active and one of those
enters seed mode, then it is excluded from active download count (thus
it becomes 2), and the next download waiting in queue gets started.
But be aware that seeding item is still recognized as active download
in RPC method.
2014-10-14 00:13:29 +09:00
Tatsuhiro Tsujikawa 09d7956537 mingw: Use MoveFileExW for better atomic move 2014-10-10 23:49:53 +09:00
David Macek 784d0e5e51 Work around libintl's vprintf macro messing with OutputFile::vprintf 2014-10-05 11:27:17 +02:00
Tatsuhiro Tsujikawa d8cde1f499 Rewrite auto_deleter_r with defer function template 2014-09-16 23:49:50 +09:00
Tatsuhiro Tsujikawa fa5998ba85 Rewrite expression template to make it a bit easier 2014-09-16 21:53:35 +09:00
Tatsuhiro Tsujikawa b63c1dce08 SessionSerializer: Use std::unique_ptr instead of std::shared_ptr 2014-09-15 16:43:46 +09:00
Tatsuhiro Tsujikawa 306d92a1da Move req 2014-09-15 14:23:00 +09:00
Tatsuhiro Tsujikawa 9a931e7c61 Fix crash on OSX when proxy is used
See GH-275
2014-09-15 14:19:59 +09:00
Tatsuhiro Tsujikawa 9b84727324 Use std::make_shared and make_unique where possible, part 2 2014-09-13 18:37:57 +09:00
Tatsuhiro Tsujikawa 596e5c6162 Refactor event poll classes so that we don't have to allocate memory on query
I left Port and libuv classes, since I don't have them compiled.
So they were updated minimally.
2014-09-13 17:33:22 +09:00
Tatsuhiro Tsujikawa f55c16c7ed Use std::unique_ptr for DHTBucketTree's left and right pointers 2014-09-13 00:49:08 +09:00
Tatsuhiro Tsujikawa e18e8aeeaa Support Adler32 checksum
Adler32 checksum is available for --checksum option and hash element
in Metalink files.  Currently, we use Adler32 implementation in Zlib.
2014-09-13 00:08:07 +09:00
Tatsuhiro Tsujikawa d91f7dc721 Use lambda 2014-09-13 00:08:07 +09:00
Tatsuhiro Tsujikawa 2807258279 Use std::make_shared and make_unique where possible, part 1 2014-09-13 00:07:21 +09:00
Tatsuhiro Tsujikawa bee7a8317c Update doc 2014-09-12 02:02:33 +09:00
Tatsuhiro Tsujikawa c0b8b471ab Fix hash function comparator 2014-09-11 23:54:17 +09:00
Nils Maier e0d6d04fe8 WinTLS: Fix abrupt connection closing and closing in general.
Fixes GH-277
2014-09-10 16:26:34 +02:00
Tatsuhiro Tsujikawa 04f875e273 WinTLS: Return 0 if eof_ is true and decBuf_ is empty 2014-09-10 21:45:08 +09:00
Tatsuhiro Tsujikawa 83c78c497b LibsslTLSSession: Treat 0 from readData as EOF 2014-09-10 21:26:06 +09:00
Tatsuhiro Tsujikawa e7e80e5ec6 WinTLS: Fix busy loop on EOF
Fixes gh#277
2014-09-10 01:11:57 +09:00
Nils Maier 0f805fb962 Silence some compiler warnings in SessionSerializer. 2014-08-30 02:03:57 +02:00
Nils Maier bd29fd2c30 Always include raw OS version number on Windows 2014-08-30 01:15:40 +02:00