Commit Graph

338 Commits (3a6f39ca7a1e0b6946c4c72f7fa37dbe6c382121)

Author SHA1 Message Date
Tatsuhiro Tsujikawa d64089632e Merge branch 'master' into random-webseeding 2016-03-26 17:20:27 +09:00
Tatsuhiro Tsujikawa 2a4d39b7e8 Don't add C++11 switch flags to CXXFLAGS 2016-01-30 19:14:38 +09:00
Tatsuhiro Tsujikawa dda0b62fb9 Add --enable-werror option to configure to enable warning flags 2016-01-22 23:22:46 +09:00
Tatsuhiro Tsujikawa f6fc952486 Don't modify user variables (e.g., CFLAGS, LIBS, etc) 2016-01-22 22:27:39 +09:00
Tatsuhiro Tsujikawa af98861aff Evict timed out pooled socket periodically
Previously we only scanned pool socket to check they are timed out
when we pooled another socket.  This means that pooled socket is not
closed long time (stays in CLOSE-WAIT state) if we don't pool any more
socket.  In this commit, we now check pooled socket periodically (30
seconds) to avoid the sockets hanging in CLOSE-WAIT state long time.

See GH-477
2015-11-11 22:31:00 +09:00
Tatsuhiro Tsujikawa 269520ee69 Don't write control file if content is not changed from previous one
This is desirable so that we don't have to wake up disk if control
file is not changed, and it is not have to be written again.  We use
the same method (SHA1 hash) to check the content is the same.  The
limitation is the hash is stored in memory, so we have to write the
first time in each session.

See GH-382
2015-11-10 23:02:21 +09:00
Tatsuhiro Tsujikawa c81b132112 Merge branch 'master' into random-webseeding 2015-10-03 17:59:39 +09:00
Tatsuhiro Tsujikawa f6f3bd3c3a Merge branch 'mingw' of https://github.com/elieux/aria2 into elieux-mingw 2015-07-19 16:30:39 +09:00
Tatsuhiro Tsujikawa ce89e26e55 Remove clock_gettime detection and its replacements 2015-06-09 03:45:40 +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
David Macek 20a04c1b8d Fix linking with libintl on MinGW-w64 2015-04-03 00:40:06 +02:00
Tatsuhiro Tsujikawa c63fc414c3 Add --stream-piece-selector=random 2015-02-14 18:33:37 +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 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
Nils Maier 8f2af33b6d Delay auth failures instead of PBKDF2
Closes GH-256
2014-07-22 21:58:30 +02:00
Nils Maier 0c8a2659ea Drop WinMessageDigestImpl.
The algorithms the `CryptProv` on Windows supports does not currently
include SHA-224, so there is a "dark spot" in this implementation. Also
on Win XP < SP3, most of the SHA-2 family is not actually supported.
All other implementation provide support for MD5, SHA-1 and all of the
SHA-2 family, hence drop the incomplete WinMessageDigest implementation
in favor of any other supported implementation (at least the internal
implementation is always available at compile-time).
2014-06-24 20:45:12 +02:00
Nils Maier 8587669995 Fix big endianess support in InternalMessageDigest and PBKDF2
- Replace sha1/md5 implementation by ones from https://github.com/nmaier/crypto
- Add endianess functionality fro https://github.com/nmaier/crypto

Closes GH-239
2014-06-24 20:45:05 +02:00
Tatsuhiro Tsujikawa 570bc24fb9 Fix use-after-free on exit with multi-file torrent download + DHT
DefaultPieceStorage may be referenced by one of DHT task (e.g.,
DHTPeerLookupTask), after RequestGroup was deleted, and even after
RequestGroupMan was deleted.  DefaultPieceStorage has a reference to
MultiDiskAdaptor which calls RequestGroupMan object on destruction.
So when DHT task is destroyed, DefaultPieceStorage is destroyed, which
in turn destroys MultiDiskAdaptor.  DHT task is destroyed after
RequestGroupMan was destroyed, MultiDiskAdaptor will use now freed
RequestGroupMan object, this is use-after-free.
2014-06-08 17:03:34 +09:00
Nils Maier 6e546245e4 Sort and cleanup src/Makefile.am 2014-05-27 21:35:42 +02:00
Nils Maier 98ba096951 Add util::security (compare, HMAC, PBKDF2)
See #220
2014-04-19 19:07:38 +02:00
Nils Maier 010131161e Remove ENABLE_MESSAGE_DIGEST, since we got the internal md, always 2014-04-17 18:02:42 +02:00
Nils Maier 32e569ab16 Fix broken EXTRA_DIST 2013-12-09 16:38:45 +01:00
Nils Maier 80528aa9ce Use some colors in progress reports (where available) 2013-11-21 15:42:42 +01:00
Tatsuhiro Tsujikawa 9e52483c04 Refactor DownloadHandlerFactory 2013-11-10 18:19:02 +09:00
Tatsuhiro Tsujikawa 2548cd4d6e Fix missing sha1.h and md5.h in Makefile.am 2013-10-20 19:09:49 +09:00
Nils Maier 00dd83b461 Implement WinTLS 2013-09-30 13:53:21 +02:00
Nils Maier 99f170b888 Provide internal ARC4 implementation
Now you can build bittorrent support without without external
libraries, meaning you can skip libnettle, libgmp, libgcrypt, GnuTLS and
OpenSSL on OSX (for now).
2013-09-24 19:11:26 +02:00
Nils Maier e854463b2d Internal implementation of DHKeyExchange
Reusing a bignum (well, unsigned very-long) implementation I had lying
around for years and just cleaned up a bit and brought to C++11 land.

It might not be the most performant implementation, but it shoud be fast
enough for our purposes and will go a long way of removing gcrypt,
nettle, gmp, openssl dependencies when using AppleTLS and WinTLS
(upcoming).
2013-09-24 19:11:00 +02:00
Nils Maier 38bdea4e06 Add internal md5 and sha1 message digests 2013-09-20 23:06:50 +02:00
Nils Maier fa30fe4b15 One MessageDigestImpl.h to rule them all. 2013-09-20 23:06:49 +02:00
Nils Maier a4e29303ef WinTLS: Implement messsage digest using the Cryptography Provider 2013-09-20 23:06:49 +02:00
Tatsuhiro Tsujikawa e3a41a51da Fix link error with Android NDK r9
Since Android ndk r9, __set_errno is deprecated. It is now defined as
inline function in errno.h. The syscall assembly calls __set_errno,
but since libc.so does not export it, the link fails. To workaround
this, replace all occurrences of __set_errno with a2_set_errno and
define it as normal C function.
2013-09-18 23:10:25 +09:00
Nils Maier 9e25335850 Implement a simple resource lock (threading)
In this initial implementation Locks are no-ops on platforms other than
Windows.
2013-08-18 06:01:52 +02:00
Nils Maier a982dee961 Switch CA_BUNDLE to AC_DEFINE 2013-08-16 22:32:16 +02:00
Tatsuhiro Tsujikawa fa9f3fb5a3 Wrap Command object in std::unique_ptr 2013-06-23 21:55:52 +09:00
Tatsuhiro Tsujikawa 286bb2840e Remove Triplet, use std::tuple instead 2013-06-22 21:08:50 +09:00
Tatsuhiro Tsujikawa 07d270c87e Require -std=c++11 and use std::shared_ptr instead of SharedHandle 2013-06-22 01:10:38 +09:00
Tatsuhiro Tsujikawa b0799b6e46 Introduce IOFile abstract class to refactor BufferedFile and GZipFile
IOFile provides the same interface of old BufferedFile. It provides
extension points as pure virtual functions. Those functions are
implemented by 2 concrete subclasses: BufferedFile and GZipFile.
2013-05-23 23:12:32 +09:00
Tatsuhiro Tsujikawa db1106101d Fix compile error without bittorrent support 2013-05-23 00:46:08 +09:00
Tatsuhiro Tsujikawa e350df2d75 Add download event callback API and its example 2013-05-11 19:40:24 +09:00
Tatsuhiro Tsujikawa c056f747c6 Install libaria2.pc only when libaria2 is enabled 2013-05-10 21:12:30 +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 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 7d55341fde Fix event polling not working with no downloads but keepRunning_ is true 2013-05-02 12:44:55 +09:00
Tatsuhiro Tsujikawa d1252dcc5f Move aria2api.{cc,h} to libaria2_la_SOURCES 2013-04-30 21:47:05 +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