Tatsuhiro Tsujikawa
ba3b823a66
Code cleanup
2013-11-10 15:36:37 +09:00
Tatsuhiro Tsujikawa
e1e6bb1ec5
Don't fail multiple concurrent dl same file if auto-file-renaming is enabled
2013-11-08 00:59:57 +09:00
Tatsuhiro Tsujikawa
2aa8e01836
Fix typo
2013-11-06 23:40:59 +09:00
Tatsuhiro Tsujikawa
9f5fdb4e10
Code cleanup
2013-11-01 22:10:24 +09:00
Tatsuhiro Tsujikawa
fd0136259c
Remove nativeToUtf8 and utf8ToNative
...
They are now not needed since we use Windows specific command-line
argument converter.
2013-11-01 22:06:13 +09:00
Tatsuhiro Tsujikawa
3a8e8f8e8a
mingw32: Use CommandLineToArgvW() and GetCommandLineW() to read cmd-line args
...
This change enables aria2 to read unicode characters in command-line.
2013-11-01 00:16:35 +09:00
Tatsuhiro Tsujikawa
b759725a61
Peer: Use std::unique_ptr for res_
2013-10-26 21:38:17 +09:00
Tatsuhiro Tsujikawa
6d2dd2ab18
DefaultPeerStorage: Code cleanup
2013-10-26 21:28:58 +09:00
Tatsuhiro Tsujikawa
234dd76cd4
DefaultPeerStorage: Add warn log when Peer::usedBy is non zero on checkoutPeer
2013-10-26 20:02:48 +09:00
Tatsuhiro Tsujikawa
12fe61820a
DefaultPeerStorage: Log origPort in checkoutPeer and returnPeer
...
Also make the log level warning when the returned peer is not found.
2013-10-26 19:58:53 +09:00
Tatsuhiro Tsujikawa
2548cd4d6e
Fix missing sha1.h and md5.h in Makefile.am
2013-10-20 19:09:49 +09:00
Tatsuhiro Tsujikawa
218dc89be9
Update doc
2013-10-20 16:04:09 +09:00
Tatsuhiro Tsujikawa
065979cda4
Remove log message "TLS else" as this function called repeatedly
2013-10-08 21:28:32 +09:00
Tatsuhiro Tsujikawa
33293bcd5a
LibsslTLSContext: Remove weak cipher suite
2013-10-08 21:26:13 +09:00
Tatsuhiro Tsujikawa
98d88ec6d5
Don't log "TLS Handshaking" twice or more
2013-10-07 23:01:51 +09:00
Tatsuhiro Tsujikawa
3080af7370
Request: Remove previousUri_
...
Historically, the previousUri_ has different meaning from referer_,
but in the course of development, they have the same value. This
change remove previousUri_ in favor of referer_.
2013-10-01 21:53:28 +09:00
Nils Maier
3b35887827
WinTLS: Enable --certifcate support
2013-09-30 16:37:09 +02:00
Nils Maier
3b9a385305
AppleTLS: Enable --certificate
...
Tested against self-signed CA with nginx
2013-09-30 16:37:01 +02:00
Nils Maier
4c84af31be
WinTLS: Fix PKCS12 loading
...
It appears that, contrary to most documentation, CERT_CONTEXT* is eaten
alive by AcquireCredentialsHandle(). Hence you cannot really reuse that.
2013-09-30 16:36:15 +02:00
Tatsuhiro Tsujikawa
50ac6afe36
util.cc: Remove uselss inline static
2013-09-30 21:50:51 +09:00
Tatsuhiro Tsujikawa
b772aa6a5e
util::percentEncodeMini: Fix regression bug removed unsignedness
...
srange-based for around std::string is convenient but several
functions depend unsigned char for correctness and readability.
2013-09-30 21:32:57 +09:00
Nils Maier
00dd83b461
Implement WinTLS
2013-09-30 13:53:21 +02:00
Nils Maier
3f1d293ed1
WinMessgeDigestImpl: gcc-4.6 does not support .emplace() yet
2013-09-29 15:47:22 +02:00
Tatsuhiro Tsujikawa
40e53de908
MessageDigestImpl.h: Simplify hash_info_t access
2013-09-28 23:40:06 +09:00
Tatsuhiro Tsujikawa
6f6a17bff7
Randomizer: Remove unused interfaces
2013-09-28 22:55:05 +09:00
Tatsuhiro Tsujikawa
986f69e5bf
SimpleRandomizer: Use std::random
2013-09-28 22:00:37 +09:00
Tatsuhiro Tsujikawa
44479c910e
Log exception; throw error if loading private key and/or certificate failed
2013-09-26 00:56:23 +09:00
Tatsuhiro Tsujikawa
7f18494a8c
SimpleRandmizer: Fix certain bits generated by getRandomBytes are always 0
...
This is because in Linux RAND_MAX is 2**31-1 and we used int32_t to
hold random number from random() and got each bytes. This means that
highest bit is always unset. In little endian system, every 4n-th (n
>=0) byte has highest bit is unset. To fix this, we just use lower 2
bytes of random().
2013-09-26 00:41:33 +09:00
Tatsuhiro Tsujikawa
ac996737e5
Move OpenSSL_add_all_algorithms() to Platform::setUp()
2013-09-26 00:17:59 +09:00
Tatsuhiro Tsujikawa
d7d5e8570b
Include prefs.h instead of typedef PrefPtr everywhere
2013-09-26 00:15:18 +09:00
Tatsuhiro Tsujikawa
8536f13cff
uri.cc: Use auto instead of adhoc typedef
2013-09-26 00:15:18 +09:00
Tatsuhiro Tsujikawa
d2af91ed08
InternalDHKeyExchange: Remove unused dtor
2013-09-26 00:13:25 +09:00
Tatsuhiro Tsujikawa
da278225c1
InternalARC4Encryptor: Fix compiler warning and remove no use ctor/dtor
2013-09-26 00:11:10 +09:00
Tatsuhiro Tsujikawa
f2a1d241c2
Merge branch 'master' into bignum-arc4
2013-09-26 00:00:24 +09:00
Tatsuhiro Tsujikawa
c81fd8e194
InternalMessageDigestImpl: Fix memory leak
2013-09-25 23:58:59 +09:00
Tatsuhiro Tsujikawa
7dc5567cad
InternalMessageDigestImpl: Code cleanup
2013-09-25 23:57:03 +09:00
Tatsuhiro Tsujikawa
77b7747ca8
Ensure that Commands are cleaned up before RequestGroupMan is deleted
2013-09-25 23:35:18 +09:00
Tatsuhiro Tsujikawa
ca8ac6e7d3
bignum.h: Fix compile error
2013-09-25 22:43:48 +09:00
Tatsuhiro Tsujikawa
6198b607e9
Merge branch 'master' into bignum-arc4
2013-09-25 21:55:32 +09: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
86c61fcf5b
Make generateRandomBytes less biased.
2013-09-24 19:07:18 +02:00
Nils Maier
e5644a7188
Revert OptionHandlerFactory changes
2013-09-24 16:17:15 +02:00
Nils Maier
d1ae9f87fd
using to typedef to make gcc-4.6 happy
2013-09-24 16:14:35 +02:00
Nils Maier
4a1d186962
Better error messages when PKCS12 import fails
2013-09-24 01:05:58 +02:00
Nils Maier
063451f0c9
TLS: Minor code cleanups
2013-09-23 15:43:11 +02:00
Nils Maier
d560bf0e6f
TLS: Fix dangling str() pointers
2013-09-23 15:10:53 +02:00
Nils Maier
37f9c668ff
Teach GnuTLS backend to load .p12 files
2013-09-22 12:55:27 +02:00
Nils Maier
f7b0fbbf53
Teach Libssl backend to load .p12 files
2013-09-22 12:55:27 +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
Nils Maier
b678bc5e10
Fix AppleMessageDigestImpl use with large data
2013-09-20 23:06:49 +02:00
Nils Maier
7738063100
AppleTLS: Remove unused variables
2013-09-20 23:06:49 +02:00
Nils Maier
3b9988251f
clang-modernize -add-override on headers
2013-09-20 23:06:49 +02:00
Nils Maier
e2700f50a5
Code cleanup in Http*
2013-09-20 23:06:49 +02:00
Nils Maier
29d569eef9
Cleanup RequestGroup code a bit
2013-09-20 23:06:49 +02:00
Nils Maier
3590077d5c
More auto-converts by cpp11-migrate
2013-09-20 23:06:49 +02:00
Nils Maier
a76eeb2b81
Introduce PrefPtr typedef
2013-09-19 19:59:33 +02:00
Nils Maier
8e6e46dfcf
More code cleanups
2013-09-19 19:59:33 +02:00
Tatsuhiro Tsujikawa
9e7579b475
Set old cookie's creation-time to new cookie on replacement
...
As described in http://tools.ietf.org/html/rfc6265#section-5.3
2013-09-20 00:24:03 +09: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
Tatsuhiro Tsujikawa
fa09dc9115
Clean up if defined style
2013-09-17 23:17:08 +09:00
Tatsuhiro Tsujikawa
acd2af82d0
util::htmlEscape: Optimize a bit
...
The cause of slowness of the first implementation is the memory
allocation overhead and appending character by character. In this
implementation, the output buffer is reserved the same size of input.
This is reasonable because most likely no replacement happens in
practice. And the unmodified region is copied using iterator range to
speed up a bit.
2013-08-29 01:09:15 +09:00
Nils Maier
75e61ee3d0
Fast-path for percentEncodeMini(string&)
2013-08-24 22:25:29 +02:00
Nils Maier
b2da75ca33
Optimize htmlEscape implementation a bit
2013-08-24 21:54:56 +02:00
Nils Maier
1b8de6bb18
Add fast-path to percentEncode(string&)
2013-08-24 21:54:36 +02:00
Nils Maier
4418ebdedc
AppleTLSSession: Remove unused private member
2013-08-24 20:08:15 +02:00
Nils Maier
522ae80fd4
Fix no-return warning in FtpInitiateConnectionCommand
...
... and untangle code a bit while at it.
2013-08-24 20:02:13 +02:00
Tatsuhiro Tsujikawa
ee2e21150b
Use std::unordered_map in IndexedList for faster speed
...
Because mingw cross compiler g++-4.6.3 does not support
std::unordered_map::emplace and std::deque::emplace, traditional
insert member function is used instead.
2013-08-21 23:46:16 +09:00
Nils Maier
cf6f58ceec
More code cleanups
2013-08-21 07:32:01 +02:00
Nils Maier
8526ceeb45
Convert to autos and ranged loops
2013-08-21 05:56:17 +02:00
Nils Maier
d8f44ef4f6
Convert most 0/NULL pointers to nullptr
...
Courtesy of llvm cpp11-migrate 3.3
2013-08-20 21:28:24 +02:00
Nils Maier
9da17424c6
Fix json::decodeGetParams when compiled with recent Apple clang
2013-08-20 20:48:49 +02:00
Nils Maier
270f429838
Fix util::nextParam when compiled with recent Apple clang
2013-08-20 20:48:49 +02:00
Tatsuhiro Tsujikawa
c26c1e234a
Move GHR outside of function and provide ctor to suppress compiler warning
...
Without ctor, compiler emits warning "unused variable ghr".
2013-08-19 23:54:54 +09:00
Tatsuhiro Tsujikawa
b6d84c0160
Use nullptr for std::shared_ptr and unique_ptr default parameter
2013-08-19 23:50:58 +09:00
Tatsuhiro Tsujikawa
5ba7150333
Code cleanup
2013-08-19 23:50:14 +09:00
Tatsuhiro Tsujikawa
7b04c841d6
Code cleanup
2013-08-19 23:40:28 +09:00
Tatsuhiro Tsujikawa
7f049dc2a4
Fix bad use of std::move
...
In the original code, std::move(cookieDomain) may be performed before
util::isNumericHost(cookieDomain), which is unintentional.
2013-08-19 23:29:08 +09:00
Nils Maier
bf5a940ed4
Define a type for signal handlers
2013-08-18 06:04:20 +02:00
Nils Maier
79fcafc31f
Win: Use SetConsoleCtrlHandler for SIGINT/SIGTERM
2013-08-18 06:04:20 +02: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
Nils Maier
303f987ee9
Add --with-disk-cache configure option
...
Enables packagers more fine grained control over the default value
without having to mess with config files.
See GH-115
2013-08-16 22:31:56 +02:00
Nils Maier
90c39522a2
Libuv: Compatiblity fix with master
2013-08-16 22:29:14 +02:00
Nils Maier
4be7ec380f
Change defaults: Enable 16M disk cache by default.
2013-08-12 20:51:19 +02:00
Tatsuhiro Tsujikawa
732ed1fb8b
Fix broken XMLRPC method call
2013-08-12 10:55:50 +09:00
Tatsuhiro Tsujikawa
8d62682202
Fix segmentation fault if RpcMethod::process throws exception
2013-08-04 00:02:52 +09:00
Tatsuhiro Tsujikawa
de55569de5
Always save control file if --force-save is given
2013-07-28 18:07:29 +09:00
Tatsuhiro Tsujikawa
41121e09f7
Use std::unique_ptr for Metalink objects
2013-07-12 23:09:23 +09:00
Tatsuhiro Tsujikawa
59e63d956e
Rewrite RPC method factory function
2013-07-11 21:50:47 +09:00
Tatsuhiro Tsujikawa
7c06b903f3
Use std::unique_ptr for ValueBase object hierarchy
2013-07-11 21:09:51 +09:00
Tatsuhiro Tsujikawa
7a57ecc5f8
DefaultBtMessageDispatcher: Remove unused members peerStorage_, pieceStorage_
2013-07-07 23:28:51 +09:00
Tatsuhiro Tsujikawa
cf8cfeefbc
DHTInteractionCommand: Use std::unique_ptr for DHTConnection
...
Remove DHTConnection from DHTMessageReceiver because it is not used.
2013-07-07 23:28:51 +09:00
Nils Maier
fc6318d23f
Fix a bad std::move in HttpConnection
...
C++ Standard says that the order of evaluation of arguments is
unspecified. Even if it wasn't, std::move would run first, invalidating
the httpRequest smartptr, so that httpRequest->createRequest() would be
executed on the invalid ptr.
Some compilers might be smart enough to correct this error, clang XCode
Edition surely is not (not should it).
2013-07-07 14:42:36 +02:00
Tatsuhiro Tsujikawa
3f5f1e26d9
Refactor PeerInterationCommand ctor
2013-07-06 22:03:37 +09:00
Tatsuhiro Tsujikawa
3c66c18489
TrackerWatcherCommand: Use std::unique_ptr for trackerRequest_
2013-07-06 21:00:57 +09:00
Tatsuhiro Tsujikawa
5378ed8c43
MultiUrlRequestFactory: Use std::unique_ptr for DownloadEngine
2013-07-06 19:45:01 +09:00
Tatsuhiro Tsujikawa
00e27e4fa4
DownloadEngine: Use std::unique_ptr for eventPoll_
2013-07-06 19:39:16 +09:00
Tatsuhiro Tsujikawa
f83b0fcfa3
Refactor MultiUrlRequestInfo ctor
...
StatCalc creation is moved to MultiUrlRequestInfo. The summary output
is done only when PREF_QUIET is false and it is always to
global::cout(), so remove summaryOut_ and just use global::cout() in
that case. Also use std::unique_ptr for statCalc_ in DownloadEngine.
2013-07-06 19:26:30 +09:00
Tatsuhiro Tsujikawa
162c138362
BtRegistry: Use std::unique_ptr for BtObject
2013-07-06 19:09:39 +09:00
Tatsuhiro Tsujikawa
cc3cd8a58b
DownloadEngine: Use std::unique_ptr for btRegistry_
2013-07-06 18:42:57 +09:00
Tatsuhiro Tsujikawa
3a3ac4ef9b
DownloadEngine: Use std::unique_ptr for dnsCache_
2013-07-06 18:38:18 +09:00
Tatsuhiro Tsujikawa
9130dc6776
DownloadEngine:: Use std::unique_ptr for webSocketSessionMan_
...
Notifier::addDownloadEventListener now takes pointer to
DownloadEventListener. Session holds unique_ptr to
ApiCallbackDownloadEventListener object.
2013-07-06 18:33:59 +09:00
Tatsuhiro Tsujikawa
81f46fbf92
Use CXX11_OVERRIDE
2013-07-06 18:15:09 +09:00
Tatsuhiro Tsujikawa
5c4f97b8a9
MultiUrlRequestInfo: Remove virtual from dtor
2013-07-06 18:14:36 +09:00
Tatsuhiro Tsujikawa
68f2a33355
DownloadEngine: Use std::unique_ptr for RequestGroupMan
2013-07-06 15:56:08 +09:00
Tatsuhiro Tsujikawa
697c1008f7
DownloadEngine: Use std::unique_ptr for checkIntegrityMan_, fileAllocationMan_
2013-07-06 15:56:08 +09:00
Tatsuhiro Tsujikawa
6b397c8125
Use std::unique_ptr for CheckIntegrityEntry and FileAllocationEntry
2013-07-06 15:56:08 +09:00
Tatsuhiro Tsujikawa
c9e58779e1
Use std::unique_ptr for IteratableValidator
2013-07-06 15:56:08 +09:00
Tatsuhiro Tsujikawa
d3a04d10a7
DefaultPieceStorage::initStorage: Clean up
2013-07-06 15:56:08 +09:00
Tatsuhiro Tsujikawa
ae84ff26e2
AbstractSingleDiskAdaptor: Use std::unique_ptr for diskWriter_
2013-07-06 15:56:08 +09:00
Tatsuhiro Tsujikawa
f8d305fe63
Use std::unique_ptr for FileAllocationIterator
2013-07-06 15:56:08 +09:00
Tatsuhiro Tsujikawa
345ba415a5
MultiDiskWriter: Rewrite resetDiskWriterEntries() using simpler algorithm
2013-07-06 15:56:08 +09:00
Tatsuhiro Tsujikawa
f000fd0cab
MultiDiskAdaptor: Use std::unique_ptr for DiskWriterEntry and DiskWriter
...
MultiFileAllocationIterator is also rewritten so that it does not
requre copying DiskWriterEntry objects.
2013-07-06 15:56:08 +09:00
Tatsuhiro Tsujikawa
28d5c7408f
Check that C++ compiler supports override keyword
...
If the compiler supports override, define CXX11_OVERRIDE as override,
otherwise define it as empty. Use CXX11_OVERRIDE instead of override.
2013-07-06 15:54:03 +09:00
Tatsuhiro Tsujikawa
cce5b3206a
Merge branch 'fix-streamfilters' of https://github.com/nmaier/aria2 into nmaier-fix-streamfilters
2013-07-06 14:39:57 +09:00
Nils Maier
093ea1de44
Fix bogus virtual override in StreamFilters
2013-07-05 20:15:55 +02:00
Nils Maier
d4044306f3
AppleTLS: Fix MessageDigestImpl
2013-07-05 20:14:49 +02:00
Nils Maier
59ba3c99f6
AppleTLS: Fix session CFRelease stuff
2013-07-05 02:00:21 +02:00
Tatsuhiro Tsujikawa
c6a733378f
Use std::unique_ptr to receive BtMessage
2013-07-04 22:35:41 +09:00
Tatsuhiro Tsujikawa
0cdeaa8177
Return nullptr directly where std::shared_ptr is expected
...
The constructor of std::shared_ptr which takes nullptr is not explicit
so we can return nullptr directly.
2013-07-04 21:44:09 +09:00
Tatsuhiro Tsujikawa
107de58997
Return nullptr directly where std::unique_ptr is expected
...
The constructor of std::unique_ptr which takes nullptr is not explicit
so we can return nullptr directly.
2013-07-04 21:33:36 +09:00
Tatsuhiro Tsujikawa
6ba1725e0f
Use std::unique_ptr for ARC4Encryptor in PeerConnection and MSEHandshake
2013-07-04 21:13:14 +09:00
Tatsuhiro Tsujikawa
b4ae039702
BinExpr, UnExpr: Make copies of args so that we can use them with rvalues
2013-07-04 03:04:50 +09:00
Tatsuhiro Tsujikawa
05d75ed218
Fix array version make_unique is invoked for 1 size_t arg accidentally
2013-07-04 03:02:33 +09:00
Tatsuhiro Tsujikawa
bc6aa3073b
Use std::unique_ptr for StreamPieceSelector instead of std::shared_ptr
2013-07-04 01:41:12 +09:00
Tatsuhiro Tsujikawa
128783cf86
Use std::unique_ptr for PieceSelector instead of std::shared_ptr
2013-07-04 01:38:24 +09:00
Tatsuhiro Tsujikawa
a479473949
Use std::unique_ptr for URISelector instead of std::shared_ptr
2013-07-04 01:16:48 +09:00
Tatsuhiro Tsujikawa
c36370ef60
Use std::unique_ptr for LpdMessage instead of std::shared_ptr
2013-07-04 00:56:29 +09:00
Tatsuhiro Tsujikawa
57f1902ee1
Use std::unique_ptr for StreamFilter instead of std::shared_ptr
2013-07-04 00:39:11 +09:00
Tatsuhiro Tsujikawa
cb205a207c
Use std::unique_ptr for HttpRequest instead of std::shared_ptr
2013-07-04 00:13:15 +09:00
Tatsuhiro Tsujikawa
9a38c102dc
Use std::unique_ptr for HttpResponse instead of std::shared_ptr
2013-07-03 23:42:55 +09:00
Tatsuhiro Tsujikawa
7e6db8d801
Use std::unique_ptr instead of array_ptr
2013-07-03 23:23:22 +09:00
Tatsuhiro Tsujikawa
c2e62cdb81
Fix compile error with i686-w64-mingw32-g++ 4.6
...
Which does not support constructor delegate
2013-07-03 23:21:47 +09:00
Tatsuhiro Tsujikawa
211f685add
BitfieldMan: Rewrite getCompletedLength and countMissingBlockNow
...
Rewritten so that no memory allocation is required for these
functions.
2013-07-03 22:40:28 +09:00
Tatsuhiro Tsujikawa
0d85fb0df3
Use std::unique_ptr for AsyncResolverMan
2013-07-03 01:30:01 +09:00
Tatsuhiro Tsujikawa
74d6d64271
Use std::unique_ptr for MessageDigest
2013-07-03 01:13:13 +09:00
Tatsuhiro Tsujikawa
f2d85c38cc
Fix segmentaion fault
2013-07-03 00:02:27 +09:00
Tatsuhiro Tsujikawa
f022402dc9
Use std::unique_ptr in DHTRegistry
2013-07-02 23:52:40 +09:00
Tatsuhiro Tsujikawa
1a5d75e819
Use std::unique_ptr to store DHTMessages instead of std::shared_ptr
2013-07-02 22:58:20 +09:00
Tatsuhiro Tsujikawa
4f7d1c395b
Use std::unique_ptr for ProgressUpdate instead of raw pointer
2013-07-01 21:59:54 +09:00
Tatsuhiro Tsujikawa
529b9fdceb
Use std::unique_ptr for ExtensionMessage
2013-07-01 21:42:51 +09:00
Tatsuhiro Tsujikawa
9e35750bb8
Code cleanup
2013-06-30 22:59:07 +09:00
Tatsuhiro Tsujikawa
098f1571be
Wrap BtMessage objects by std::unique_ptr instead of std::shared_ptr
2013-06-30 22:55:43 +09:00
Tatsuhiro Tsujikawa
abcb0745ed
Fix unitest compile error
2013-06-30 01:03:39 +09:00
Tatsuhiro Tsujikawa
03ae308faa
Use RequestSlot as pointer to avoid copying
2013-06-30 00:31:50 +09:00
Tatsuhiro Tsujikawa
d128a39fb6
HttpServer: Return bool for receiveHeader, use std::unique_ptr for headers
2013-06-29 23:20:43 +09:00
Tatsuhiro Tsujikawa
6a3e26a34d
Remove accidentally added const
2013-06-29 23:11:14 +09:00
Tatsuhiro Tsujikawa
5a223115e0
Rewrite CookieStorage
2013-06-29 23:09:09 +09:00
Tatsuhiro Tsujikawa
0b1e05b13b
Fix compile error
2013-06-27 00:20:48 +09:00
Tatsuhiro Tsujikawa
da7400ef5c
Return std::unique_ptr member as const ref
...
Returning raw pointer has a risk that it may be stolen by
std::shared_ptr in accident.
2013-06-26 23:56:43 +09:00
Tatsuhiro Tsujikawa
47402c5f29
Refactor HttpConnection and its neighbor objects
2013-06-26 23:19:15 +09:00
Tatsuhiro Tsujikawa
d485c8e767
Rewrite AuthConfig objects using std::unique_ptr
2013-06-26 21:45:29 +09:00
Tatsuhiro Tsujikawa
a4cf50914d
HttpRequest: Use raw non-owning pointer for cookieStorage_
2013-06-25 23:01:00 +09:00
Tatsuhiro Tsujikawa
4803482a51
HttpRequest: Store non-owning raw pointer for authConfigFactory_
2013-06-25 22:06:29 +09:00
Tatsuhiro Tsujikawa
6bcf33a69e
Fix compile error with clang
2013-06-25 02:57:48 +09:00
Tatsuhiro Tsujikawa
2761301dfb
Rewrite util::divide
2013-06-25 00:07:15 +09:00
Tatsuhiro Tsujikawa
2f6eff3821
download_helper: Cleanup
2013-06-24 23:49:49 +09:00
Tatsuhiro Tsujikawa
b364c2436b
toUpper, toLower: Let compiler copy src
2013-06-24 23:23:34 +09:00
Tatsuhiro Tsujikawa
10cdc59297
Remove vbegin and vend in favor of std::begin and std::end
2013-06-24 21:46:42 +09:00
Tatsuhiro Tsujikawa
d2ec57057e
HttpServer: Use std::unique_ptr for lastBody_ and headerProcessor_
2013-06-23 23:44:38 +09:00
Tatsuhiro Tsujikawa
fba7e7ee8b
Use move to send string data into SocketBuffer::pushStr
2013-06-23 23:31:07 +09:00
Tatsuhiro Tsujikawa
508109edbb
SocketBuffer: Use std::unique_ptr to store BufEntry
2013-06-23 23:06:12 +09:00
Tatsuhiro Tsujikawa
c0b60eb087
Use std::unique_ptr for UnionSeedCriteria
2013-06-23 22:07:25 +09:00
Tatsuhiro Tsujikawa
fa9f3fb5a3
Wrap Command object in std::unique_ptr
2013-06-23 21:55:52 +09:00
Tatsuhiro Tsujikawa
bb5b7eeedb
Move RequestGroup vector from Context to RequestGroupMan
2013-06-23 16:35:14 +09:00
Tatsuhiro Tsujikawa
28c84148e4
Pass std::unique_ptr by value
2013-06-23 16:24:47 +09:00
Tatsuhiro Tsujikawa
23086b6e21
AbstractBtMessage: Use std::unique_ptr for validator
2013-06-23 16:12:19 +09:00
Tatsuhiro Tsujikawa
a18bba7c66
DefaultBtMessageReceiver: Use raw pointer for non-owning object
2013-06-23 12:29:18 +09:00
Tatsuhiro Tsujikawa
85f5134626
DefaultBtMessageDispatcher: Use raw pointers for non-owning objects
2013-06-23 12:25:58 +09:00
Tatsuhiro Tsujikawa
9db01bed71
DefaultBtAnnounce: Use non-owning raw pointer for downloadContext_
2013-06-23 12:14:17 +09:00
Tatsuhiro Tsujikawa
bfb732c5d4
DefaultBtRequestFactory: Use raw pointer for pieceStorage_
2013-06-23 12:02:36 +09:00
Tatsuhiro Tsujikawa
bef6236da8
DownloadContext::attrs_ now holds std::unique_ptr
...
DownloadContext::getAttribute() returns a raw pointer.
2013-06-23 00:59:55 +09:00
Tatsuhiro Tsujikawa
1a299c4d7c
Use raw pointers to PieceStorage, PeerStorage and DownloadContxt for BtMessages
2013-06-23 00:01:40 +09:00
Tatsuhiro Tsujikawa
09c597fbb8
ParameterOptionHandler: Use initializer lists for params
2013-06-22 23:19:54 +09:00
Tatsuhiro Tsujikawa
286bb2840e
Remove Triplet, use std::tuple instead
2013-06-22 21:08:50 +09:00
Tatsuhiro Tsujikawa
5cb7ae0b86
Use std::unique_ptr in SingletonHolder
2013-06-22 19:36:42 +09:00
Tatsuhiro Tsujikawa
ca329a7ccb
Use std::mem_fn instead of std::mem_fun
2013-06-22 19:15:57 +09:00
Tatsuhiro Tsujikawa
38d4574355
Remove forEachMemFunSH in favor of for loop with auto
2013-06-22 19:04:52 +09:00
Tatsuhiro Tsujikawa
05d85e2965
Remove auto_delete in favor of std::unique_ptr
2013-06-22 18:51:29 +09:00
Tatsuhiro Tsujikawa
e791eb9ca3
Cleanup a2functional.h
...
Remove mem_fun_sh in favor of std::mem_fun. Remove unused functions.
Use std::mem_fn instead of mem_fun_sh
2013-06-22 17:53:39 +09:00
Tatsuhiro Tsujikawa
50dcd6394c
Use std::unique_ptr instead of std::shared_ptr
2013-06-22 15:49:41 +09:00
Tatsuhiro Tsujikawa
c330ac901d
Fix mingw32 compile error
2013-06-22 01:23:08 +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
126a4bde61
Rewrite URI path component normalization
2013-06-19 00:15:37 +09:00
Tatsuhiro Tsujikawa
f022444d81
Join URI on redirect
2013-06-18 00:15:23 +09:00
Tatsuhiro Tsujikawa
4a106e7fcf
Send HAVE message to the peer which the piece is downloaded from
...
Historically, aria2 did not send HAVE message to the peer which the
piece is coming from, thinking it is obvious that the peer knows we
have the piece. But it is not obvious if one piece is download from
more than 1 peers (e.g., end game mode). So it is better to send HAVE
to all peers connected.
2013-06-13 21:42:33 +09:00
Tatsuhiro Tsujikawa
e3506b04fb
Revert 9eea959
only the parts which affect src/BtPieceMessage.cc
...
This is because we are not sure that peer has a piece just sending off
its block. It should be notified by the peer.
2013-06-13 21:34:08 +09:00
Tatsuhiro Tsujikawa
9eea959455
Improve peer bitfield and piece stat update
...
On HAVE message reception and PIECE message transmission, update peer
bitfield and piece stat only if current peer bitfield indicates it
does not have the piece.
2013-06-12 23:21:18 +09:00
Tatsuhiro Tsujikawa
4ff6a9f1d4
Do the same doc improvements to --follow-metalink
2013-06-12 21:37:30 +09:00
gt
75d3e6f4dd
Improvements to --follow-torrent=false documentation.
2013-06-11 23:49:09 +05:30
Tatsuhiro Tsujikawa
81e6b68443
Pass A2Gid by value, since it is uint64_t
2013-06-12 00:09:42 +09:00
Nils Maier
3b32dcb9f1
SessionSerializer: Truly unique URIs
...
Before, only spent uris where sanitized not to be contained within
remaining uris. Change this so that each uri in the
union(remaining,spent) get saved once at most.
The order of the uris will won't be changed, with remaining uris going
first followed by spent uris.
Also avoid copying the uri std::strings around during dupe checking,
usually resulting in better performance regarding CPU and space.
2013-06-10 00:58:28 +02:00
Tatsuhiro Tsujikawa
d444a6cc9e
Make getOption RPC method return option for stopped downloads
2013-05-28 22:55:09 +09:00
Tatsuhiro Tsujikawa
fde376efbc
SessionSerializer: Save spent URIs as well as remaining ones
2013-05-28 21:44:17 +09:00
Tatsuhiro Tsujikawa
e4bf9b9cc5
Implement DownloadResultDH::getOption()/getOptions()
2013-05-27 21:45:33 +09:00
Tatsuhiro Tsujikawa
3616b75e8a
Fix redeclaration warning on opensolaris
2013-05-26 16:15:57 +09:00
Tatsuhiro Tsujikawa
ce9eec5cb2
Include winsock2.h before windows.h
2013-05-25 23:28:28 +09:00
Tatsuhiro Tsujikawa
e760b3bd6e
Fix compiler warning with openssl
2013-05-25 23:27:56 +09:00
Tatsuhiro Tsujikawa
84769bce57
Fix compile error without message digest support
2013-05-25 22:38:57 +09:00
Tatsuhiro Tsujikawa
bc3b162569
Remove open_ member from BufferedFile and GZipFile
...
Just checking fp_ is sufficient.
2013-05-23 23:28:08 +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
6c0fa43fa5
Update doc
2013-05-23 21:18:54 +09:00
Tatsuhiro Tsujikawa
db1106101d
Fix compile error without bittorrent support
2013-05-23 00:46:08 +09:00
Tatsuhiro Tsujikawa
b9436e4d12
Fix uninitialized values
2013-05-23 00:45:50 +09:00
Tatsuhiro Tsujikawa
b7a3976456
Fix position of parenthesis
2013-05-23 00:43:37 +09:00
Nils Maier
e25c0955c5
Fix invalid reference return in IndexedListIterator
2013-05-19 18:02:44 +02:00
Tatsuhiro Tsujikawa
2ed68f7ea3
Don't install aria2.h when libaria2 is disabled
2013-05-18 19:36:25 +09:00
Tatsuhiro Tsujikawa
93db904e48
Add reference marker to EXIT STATUS section
2013-05-18 16:37:58 +09:00
Tatsuhiro Tsujikawa
a4b29ac2f7
Add getGlobalStat API
2013-05-18 15:41:40 +09:00
Tatsuhiro Tsujikawa
c688f51f2e
Don't return hidden option from DownloadHandle::getOption and getGlobalOption
2013-05-17 23:06:34 +09:00
Tatsuhiro Tsujikawa
45506573a8
Rename KeyVals DownloadHandle::getOption() as getOptions
2013-05-17 23:00:37 +09:00
Tatsuhiro Tsujikawa
06377d77c9
Add changeGlobalOption, getGlobalOption, getGlobalOptions API
2013-05-17 22:56:21 +09:00
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
Tatsuhiro Tsujikawa
56fac58b4d
Parallel A and AAAA record lookups with c-ares
2013-03-31 18:02:45 +09:00
Tatsuhiro Tsujikawa
5535ed5f95
Code cleanup
2013-03-18 22:45:07 +09:00
Tatsuhiro Tsujikawa
d88e815033
Fix bug that invalid range error when requesting range starting 0
...
Since the change b782a56b
, we use endOffsetOverride_ as the return
value of getEndByte(). But aria2 does not send Range header field when
range starts 0 (this is because some server returns error if it
received Range: 0-), and the HttpRequest::isRangeSatisfied() checks
the equality of getEndByte() and the end byte in response header and
fails. The fix is send Range header if getEndByte() is set.
2013-03-18 22:01:36 +09:00
Tatsuhiro Tsujikawa
0fa92911d7
util.cc: Include only signal.h for opensolaris build
2013-03-17 15:42:50 +09:00
Tatsuhiro Tsujikawa
0741a14486
Revert 6b55f5d3
because it breaks opensolaris build
2013-03-17 15:42:16 +09:00
Tatsuhiro Tsujikawa
18ad88088d
Fix typo in GZipFile.h spelling
2013-03-16 20:40:39 +09:00
Tatsuhiro Tsujikawa
85de8b0642
Revert DownloadEngine.cc change in 6b55f5d3
because Debian Lenny breaks
2013-03-04 22:32:51 +09:00
Tatsuhiro Tsujikawa
588ee2f1cc
GZipFile: Move buf_, buflen_ to initializer list
2013-03-03 22:55:44 +09:00
Tatsuhiro Tsujikawa
43cb2d880a
Rewrite GZipFile::vprintf()
...
MINGW does not have vasprintf(), so we use _vscprintf() and
vsnprintf(). We want to reuse buffer, so for non-MINGW we use
vsnprintf() with retrying doubling buffer size if output is truncated.
2013-03-03 21:49:42 +09:00
Tatsuhiro Tsujikawa
e17d0f8d4e
Bring back datetime in console log
2013-03-03 18:35:07 +09:00
Tatsuhiro Tsujikawa
66a85777ad
Document UDP tracker in manual
2013-03-03 18:28:25 +09:00
Tatsuhiro Tsujikawa
baaa3a4fb2
Use IndexedList::remove_if to clean up RequestGroupMan::removeStoppedGroup
2013-03-03 18:08:19 +09:00
Tatsuhiro Tsujikawa
d4ba562710
Implement IndexedList::iterator
...
It is dangerous to expose internal iterator to the outside, which is
easily misused.
2013-03-03 18:00:42 +09:00
Tatsuhiro Tsujikawa
421ae13d40
Run checksum check if -V and -c are used and file is completed
...
With -c option, aria2 can continue download after the existing file
position. If it is not completed, then after completion aria2 runs
checksum checking if available. But if existing file has already been
completed, then CreateRequestCommand exits without issuing checksum
checking. And aria2 treats it download error because it needs checksum
verification but it has not been done. This change fixes this by
properly checking download state and issue checksum checking before
CreateRequestCommand.
2013-03-03 17:18:12 +09:00
Tatsuhiro Tsujikawa
9b99875478
Add writeOptionLine() to format 1 line of option name/value pair
2013-03-03 14:12:59 +09:00
Tatsuhiro Tsujikawa
6b55f5d393
Do changes in 8aa1db6
in other places which include signal.h
2013-03-03 13:41:03 +09:00
Tatsuhiro Tsujikawa
7c66d1952a
Merge branch 'mingw-signal' of https://github.com/nmaier/aria2 into nmaier-mingw-signal
2013-03-03 13:28:51 +09:00
Tatsuhiro Tsujikawa
122e5929c1
SessionSerializer: Remove check fp because it is always true
2013-03-03 13:20:54 +09:00
Tatsuhiro Tsujikawa
f4469b79aa
SessionSerializer crash when filename length is less than 3
2013-03-03 13:19:52 +09:00
Tatsuhiro Tsujikawa
910e40f128
Fix missing value in serialized pause option
2013-03-03 13:17:49 +09:00
Nils Maier
f2f8b14047
Support for gzipped -i and --save-session
...
Saved sessions may very large, as in hundreds and even thousands of
megabyte when dealing with large queues.
Add support to save and reload sessions to gzipped files, when libz is
available.
The session serializer will output gzipped contents when the file ends
with .gz, while the input file reader (UriListParser) will accept
whatever is thrown at it.
2013-03-02 15:48:26 +01:00
Nils Maier
b0556a7519
Do not use a virtual varargs function
...
This stuff breaks in some compiler (configurations)
2013-03-02 15:48:26 +01:00
Nils Maier
8aa1db682b
Check for sys/signal.h and/or signal.h
...
mingw-w64 does not actually have sys/signal.h, while OSX currently has a
broken signal.h
Better check the presence of both and use sys/signal.h if present, else
signal.h
2013-03-02 15:09:54 +01:00
Nils Maier
7f6a446750
Hygiene: Fix some clang warnings, mostly unused private members.
2013-03-01 13:17:52 +01:00
Nils Maier
62f842579d
Fix bustage on OSX with ./configure CC=cc CXX=c++ (clang)
2013-03-01 12:43:40 +01:00
Tatsuhiro Tsujikawa
e4bd910d43
Update doc
2013-02-26 23:43:52 +09:00
Tatsuhiro Tsujikawa
704eebfac6
Use std::remove_if
2013-02-26 23:43:20 +09:00
Tatsuhiro Tsujikawa
7f805df4f0
Use std::remove_if
2013-02-26 22:59:28 +09:00
Tatsuhiro Tsujikawa
4ac4fdf1e9
Use same port number for IPv4 and IPv6 DHT
2013-02-26 22:44:19 +09:00
Tatsuhiro Tsujikawa
33037982dc
Improve log message for server socket
2013-02-26 22:44:15 +09:00
Tatsuhiro Tsujikawa
dfac717dbf
Merge branch 'fix-initial-rq-leak' of https://github.com/nmaier/aria2 into nmaier-fix-initial-rq-leak
2013-02-26 21:56:37 +09:00
Nils Maier
d1301b8697
Do not reference RequestGroups longer than necessary
...
There is an initial vector of SharedHandle<RequestGroup> to seed the
DownloadEngine. This vector was however kept alive via main.cc ->
MultiUrlRequestInfo up until the program exits, hence effetively leaking
all initial RequestGroups and associated object instances.
Hence, as a matter of dirty-workaround, drop the contents of that initial
vector as soon as it is not required any longer.
2013-02-26 10:49:24 +01:00
Nils Maier
11b9f3ebe2
Detect console with on Windows
...
Signed-off-by: Nils Maier <maierman@web.de>
2013-02-25 20:47:43 +01:00
Tatsuhiro Tsujikawa
a49397ed19
Fix infinite loop when size of downloadResults_ exceeds maxDownloadResult_
2013-02-25 21:42:54 +09:00
Tatsuhiro Tsujikawa
2aeb7137d0
Log host and port when unexpected or unknown UDP tracker reply is received
2013-02-25 01:14:27 +09:00