Commit Graph

3619 Commits (479e4e8aee22a23cb6765aaaffead3542ec8b8c9)

Author SHA1 Message Date
103yiran d3e9c34bd5 correcting the copyright format error 2016-07-20 11:09:20 +08:00
103yiran 24949b7c70 correcting the copyright format error 2016-07-20 11:04:59 +08:00
Nils Maier f5ceeebe86 Fix some compiler warnings 2016-07-19 20:55:42 +02:00
Nils Maier 665a1d1b35 Better auto-renaming
Up until now aria2 file auto renaming worked by just appending a new
unique number to the file path, behind the file name extension, if any,
changing what most other programs consider the file extension in the
process.
Now, aria2 will attempt to insert the number before the file extension,
leaving the extension intact, so that e.g. a ".jpg" still is a ".jpg"
file and opens in your configured image viewer when clicking it.
If a file has no extension (incl. so called "dot files"), the number
will be appended to the file name as usual.

Note: This is a potentially breaking change that might break third party
scripts that rely on aria2 auto file renaming producing a certain format
for renamed files. Please fix your scripts accordingly.

Closes GH-709
2016-07-19 20:55:41 +02:00
Nils Maier b6d9e7a01f Log number of items loaded from input file 2016-07-19 20:55:41 +02:00
Tatsuhiro Tsujikawa 196e4cbede Use C++ style cast 2016-07-18 17:41:09 +09:00
Tatsuhiro Tsujikawa 196f8c4ad9 Fix help output 2016-07-18 17:38:52 +09:00
Tatsuhiro Tsujikawa 99e5d85de0 Merge branch 'seed' of https://github.com/SSSSeb/aria2 into SSSSeb-seed 2016-07-18 17:34:34 +09:00
Tatsuhiro Tsujikawa 3220989f56 Link external libraries to libaria2 with --enable-libaria2 2016-07-17 19:17:12 +09:00
Tatsuhiro Tsujikawa 777b818690 Add offset value to Timer::clock::now() to treat 0 as special value 2016-07-14 00:52:43 +09:00
Sébastien Cabaniols 7410b27990 allow seconds for seed-time (fractional minutes) 2016-07-12 09:58:56 +02:00
Tatsuhiro Tsujikawa 01f870221b Fix have entry removal 2016-07-11 01:29:12 +09:00
Tatsuhiro Tsujikawa babdcb2c7d Change have entry indexing method
Now use increasing sequence of integer rather than timer value.
2016-07-10 22:42:49 +09:00
Tatsuhiro Tsujikawa f2aa7564b0 Remove unnecessary condition 2016-07-10 00:05:08 +09:00
Tatsuhiro Tsujikawa 4d27668d7c Decide interest and choking after receiving messages 2016-07-10 00:04:42 +09:00
Tatsuhiro Tsujikawa c4cf8fa61d Send have message without too much delay
Also send bitfield rather than have messages if bitfield message is
equal to or less than the sum of have messages which otherwise would
be sent.
2016-07-09 21:36:57 +09:00
Tatsuhiro Tsujikawa ae11b7a85d Fix bug that causes bogus EOF connection failure in BitTorrent downloads 2016-07-09 21:36:57 +09:00
Tatsuhiro Tsujikawa 41df1607f6 Fix frequent interested/not interested message transmission 2016-07-09 21:36:57 +09:00
Tatsuhiro Tsujikawa 570d46725f Fix frequent choke/unchoke message transmission 2016-07-09 21:36:57 +09:00
Tatsuhiro Tsujikawa 360ca57231 Try to use available URI if all pooled requests are sleeping 2016-07-07 23:51:51 +09:00
Tatsuhiro Tsujikawa a1ce6d2e7f Set server status error on network failure 2016-07-05 23:15:52 +09:00
Tatsuhiro Tsujikawa 295affe160 Disable AI_ADDRCONFIG if no IPv4/IPv6 address is configured for any interface 2016-07-04 22:06:35 +09:00
Tatsuhiro Tsujikawa 4df7b540a2 Fix warning "Cannot fid peer ... in usedPeers_" 2016-07-03 05:26:41 +09:00
Tatsuhiro Tsujikawa f7cbbfd209 Retain peers obtained earlier 2016-07-02 16:05:22 +09:00
Tatsuhiro Tsujikawa d38da969a5 Apply --retry-wait on 503 only 2016-06-21 23:46:54 +09:00
Tatsuhiro Tsujikawa e8fcedf092 Take into account timeout 2016-06-21 23:30:39 +09:00
Tatsuhiro Tsujikawa 10b64e281a Ensure that lowest speed check is done even when download speed is 0 2016-06-21 23:25:24 +09:00
Tatsuhiro Tsujikawa 2365c91994 Document that -o is always relative to -d option 2016-06-21 22:50:37 +09:00
Tatsuhiro Tsujikawa 1e59e357af Fix compile error on OS X 2016-06-19 19:08:17 +09:00
Tatsuhiro Tsujikawa f6f672f4d9 Allow larger ut_metadata size 2016-06-17 23:07:55 +09:00
Tatsuhiro Tsujikawa a86a823f50 mingw: Change FD_SETSIZE to 32768 2016-06-16 23:00:21 +09:00
Tatsuhiro Tsujikawa fa07d0be35 Fix uninitialized variable 2016-06-14 21:55:42 +09:00
Tatsuhiro Tsujikawa 2dd10c9645 Revert "Remove dead code"
This reverts commit fd024e6773.
2016-06-12 09:52:58 +09:00
Tatsuhiro Tsujikawa fd024e6773 Remove dead code 2016-06-10 00:18:35 +09:00
Tatsuhiro Tsujikawa e220c53849 BitTorrent: Allow 32KiB request
It looks like the 32KiB is the default request size of python
bittorrent client.  Previously, aria2 only allowed maximum 16KiB
request.
2016-06-10 00:14:48 +09:00
Tatsuhiro Tsujikawa 0d14444f0b Merge branch 'master' into dynamic-select-file 2016-06-07 21:13:09 +09:00
Tatsuhiro Tsujikawa 887f7a6b90 Fix busy loop when upload rate limit hits 2016-06-06 23:41:33 +09:00
Tatsuhiro Tsujikawa 5ec84f9eae Enable write socket check when there is pending messages to send 2016-06-05 11:26:41 +09:00
Tatsuhiro Tsujikawa 93bd6cfbb8 Disable opt unchoking for bad peer 2016-06-05 11:26:08 +09:00
Tatsuhiro Tsujikawa 22a91dfe12 Set Peer::chokingRequired(true) for all active peers 2016-06-05 11:22:20 +09:00
Tatsuhiro Tsujikawa 12b903f312 Set Peer::chokingRequired(true) for all active peer 2016-06-05 11:21:48 +09:00
Tatsuhiro Tsujikawa e31a49b8ee Don't unchoke peer which is not interested in us 2016-06-05 11:10:20 +09:00
Tatsuhiro Tsujikawa ef9e67aeb2 Fix bug that evaluation of Peer::amChoking is negated 2016-06-05 11:09:30 +09:00
Tatsuhiro Tsujikawa b95d7fbfec Remove PeerStorage:scheduleForcedChokeRound since it is not effective 2016-06-04 22:11:51 +09:00
Tatsuhiro Tsujikawa 6b8611885b Unchoke not-uploading peer if we could not find 3 regular unchokers 2016-06-04 22:10:34 +09:00
Tatsuhiro Tsujikawa 482cf6aca4 Fasten seed/download on fast connection 2016-06-02 22:13:47 +09:00
Tatsuhiro Tsujikawa a0706f5a44 Make seeder do more get_peers to announce its presence 2016-06-02 00:09:54 +09:00
Tatsuhiro Tsujikawa 9486663259 Increase DHT task concurrency to 15 2016-05-31 22:24:19 +09:00
Tatsuhiro Tsujikawa b64ea39c7b Clang-format and small amends
mapaddr_ is always nullptr in this context, so no need to set to
nullptr again.
2016-05-31 22:21:17 +09:00
Tatsuhiro Tsujikawa eac72b9045 Merge branch 'fix-mmap-check' of https://github.com/c3V6a2Vy/aria2 into c3V6a2Vy-fix-mmap-check 2016-05-31 22:16:42 +09:00
Tatsuhiro Tsujikawa 3e00be26e8 Include local IP address to DHT GetPeers reply message
This is required when DHT is used in private network, where seeder is
initially not known to all nodes.  This functionality requires
--bt-external-ip is set since aria2 cannot figure out external IP
address to advertise in general.
2016-05-27 23:28:53 +09:00
suzker fa43431974 fixed mmap failure check with MAP_FAILED flag 2016-05-27 02:07:02 -07:00
suzker ef0a2e601f Compare filesize directly to the numeric max of size_t 2016-05-25 07:43:57 -07:00
suzker 43aea5c940 added filesize overflow check for mmap on 32bit os 2016-05-24 16:37:31 -07:00
Tatsuhiro Tsujikawa c57259f8e7 Use standard percent-encode for tracker request query 2016-05-23 22:16:04 +09:00
Tatsuhiro Tsujikawa 9d40c47799 Merge branch 'master' into dynamic-select-file 2016-05-22 20:57:33 +09:00
Tatsuhiro Tsujikawa 949a580a14 mingw32: Gain privilege before opening files 2016-05-18 22:59:46 +09:00
Tatsuhiro Tsujikawa 9727b5b256 Merge branch 'master' into dynamic-select-file 2016-05-16 12:27:14 +09:00
Tatsuhiro Tsujikawa 56a114746a Use std::make_shared for efficiency 2016-05-16 00:05:28 +09:00
Tatsuhiro Tsujikawa cef9109070 Refactor BtBitfieldMessage 2016-05-16 00:03:02 +09:00
Tatsuhiro Tsujikawa dae42d0cd0 Remove unused SimpleBtMessage::getMessageLength 2016-05-15 23:44:54 +09:00
Tatsuhiro Tsujikawa a7237c69f7 Refactor BitTorrent message buffer usage 2016-05-15 23:40:52 +09:00
Tatsuhiro Tsujikawa cc8375f0b0 Refactor BtHandshakeMessage 2016-05-15 22:00:16 +09:00
Tatsuhiro Tsujikawa 2449ee6a76 Simplify cache write
The previous cache write routine was too complex.  I'm sure I can
rewrite it to more elegantly.  But the primary motivation of this
complex logic is for disk activity reduction on Windows 7, and I
observed it on my old IDE disk.  I checked it again recently, and
there is no difference between with and without this complex logic.
For this reason, it was removed.  Will revert this change if many of
users are not happy with this.
2016-05-15 18:47:13 +09:00
Tatsuhiro Tsujikawa bafbbe7c1d Allow subsecond value in ns cookie.txt file's expiry time field 2016-05-15 18:40:50 +09:00
Tatsuhiro Tsujikawa 6976ffed9e Adjust chromium cookie time 2016-05-15 17:58:01 +09:00
Tatsuhiro Tsujikawa 3443349fc3 Refactor 2016-05-14 19:50:58 +09:00
Tatsuhiro Tsujikawa 8897d7ec70 Restart active download to apply previously not applicable options
Previously, we categorized options that can be used in
aria2.changeOption RPC method into 2 categories.  The options in one
category can be applied on the fly, meaning that download continues to
be active while applying options.  Another category includes options
which are only applicable when downloads are waiting or paused.

In this change, when active download is ordered to change options
which only applicable in waiting or paused state, it is now paused,
and then automatically restarted.  Although we have limited number of
download concurrency, the pause and restart is done atomically, and
the download is inserted at the front of the queue, it is picked up
immediately if the concurrency regulation allows.
2016-05-06 18:31:50 +09:00
Tatsuhiro Tsujikawa e174b90ff2 Fix compile error 2016-05-02 23:51:16 +09:00
Tatsuhiro Tsujikawa 94a45bfbfc Documented new options 2016-04-27 00:28:27 +09:00
Tatsuhiro Tsujikawa db239c2853 Add --stderr option to redirect all stdout log output to stderr 2016-04-27 00:16:55 +09:00
Tatsuhiro Tsujikawa aa863fa4d1 Add "hide" to --download-result option 2016-04-26 23:35:44 +09:00
Tatsuhiro Tsujikawa 3c637fa3d5 Fix downloaded metaurl torrent filename 2016-04-23 19:29:01 +09:00
Tatsuhiro Tsujikawa 1ce6ac0b23 Add error handling for sigaction, signal and strdup 2016-04-23 18:18:06 +09:00
Tatsuhiro Tsujikawa b316b2cec5 clang-format 2016-04-21 23:03:24 +09:00
Tatsuhiro Tsujikawa aab2472390 Remove trailing "." from SAN and CN 2016-04-21 23:02:58 +09:00
rotor cefea5db5a Add a little bit of color to have a better visual of important informations 2016-04-20 00:22:34 +09:00
Tatsuhiro Tsujikawa e8bd019570 Relocate from github.com/tatsuhiro-t/aria2 to github.com/aria2/aria2 2016-04-18 22:31:07 +09:00
Tatsuhiro Tsujikawa 1126722bd3 mingw: Defer the falloc warning until falloc is specified by option 2016-04-18 22:17:41 +09:00
Tatsuhiro Tsujikawa ca634a82bd Add bittorrent key to aria2.tellStopped status 2016-04-17 21:06:41 +09:00
Tatsuhiro Tsujikawa 2e0e8ed0e5 Amend 2016-04-15 23:54:10 +09:00
Tatsuhiro Tsujikawa 302bdfd9a0 Merge branch 'RpcTellStatus-Hashing' of https://github.com/kkartaltepe/aria2 into kkartaltepe-RpcTellStatus-Hashing 2016-04-15 23:33:26 +09:00
Tatsuhiro Tsujikawa 8fc28a9e43 clang-format 2016-04-15 23:31:00 +09:00
Tatsuhiro Tsujikawa cf1dd06d03 Merge branch 'system.listNotifications' of https://github.com/sonnyp/aria2 into sonnyp-system.listNotifications 2016-04-15 23:26:38 +09:00
Tatsuhiro Tsujikawa 437d4aa776 Fix compile error with Android NDK 2016-04-15 23:09:54 +09:00
Tatsuhiro Tsujikawa a474183bd3 clang-format 2016-04-15 23:09:54 +09:00
Tatsuhiro Tsujikawa ce868d75bd Fix issues reported by coverity 2016-04-13 19:20:19 +09:00
Sonny Piers d3f16a5711 system.listNotifications RPC method 2016-04-08 18:09:50 +02:00
Tatsuhiro Tsujikawa 395b8e93c5 Make single-etnry metalink download with multi-file torrent work 2016-03-27 19:29:19 +09:00
Tatsuhiro Tsujikawa d64089632e Merge branch 'master' into random-webseeding 2016-03-26 17:20:27 +09:00
Tatsuhiro Tsujikawa a7cd943a06 clang-format 2016-03-26 00:35:16 +09:00
Tatsuhiro Tsujikawa 2a8522f6a5 Attemp to fix compile error 2016-03-26 00:32:00 +09:00
Kurt Kartaltepe 2417225023 Report CheckIntegrity info in tellStatus
- Adds verifiedLength to tellStatus. Reports the length of data that has
been verified of the current RequestGroup being verified.
- Adds verifyPending to tellStatus. Reports if the RequestGroup has a
verification of integrity pending.

Closes #561
2016-03-22 23:38:38 -05:00
Tatsuhiro Tsujikawa f316c94710 Ignore floating number in torrent file 2016-03-17 23:28:28 +09:00
Tatsuhiro Tsujikawa bf3d95c5d1 Give advanced tag to optimize-concurrent-downloads option 2016-03-16 22:11:51 +09:00
Tatsuhiro Tsujikawa db5af2cec3 Fit into 80 columns 2016-03-16 21:40:42 +09:00
Tatsuhiro Tsujikawa 60d0cb0e24 Remove trailing white spaces 2016-03-16 21:25:43 +09:00
oliviercommelarbre 9e05371fb6 Added support for a dynamic management of the number of concurrent downloads as a function of the overall bandwidth observed 2016-03-16 21:22:49 +09:00
Tatsuhiro Tsujikawa f0f1b8ef47 clang-format-3.6 2016-03-15 23:49:56 +09:00
Tatsuhiro Tsujikawa 4595aa75e1 SessionSerializer: Fix bug that pause=true is added to wrong item
This change also defers writing metadata download to the location
where first its follower download is written.
2016-03-13 16:11:29 +09:00
Tatsuhiro Tsujikawa 21754fa103 Add following to aria2.tellStatus response key as reverse link for followedBy 2016-03-05 14:20:42 +09:00
Tatsuhiro Tsujikawa 74811ddaff mingw: Add warning for falloc 2016-03-03 22:19:57 +09:00
Nils Maier fc490ac05c Update ciphers in AppleTLS
Also enable fast start while at it
2016-03-03 06:17:46 +01:00
Tatsuhiro Tsujikawa 8985d66e71 Fix compile error without TLS support 2016-02-23 01:37:38 +09:00
Athmane Madjoudj c275b6f297 Remove trailing spaces 2016-02-17 00:12:24 +01:00
Athmane Madjoudj 1849ccfbba Add support for using gnutls system wide crypto policy 2016-02-17 00:11:23 +01:00
Tatsuhiro Tsujikawa a6970895ac clang-format 2016-02-16 00:20:12 +09:00
Tatsuhiro Tsujikawa 8d30869966 Fix compile error with --disable-bittorrent 2016-02-15 23:54:51 +09:00
Tatsuhiro Tsujikawa 8684923344 Merge branch 'patch-2' of https://github.com/kwkam/aria2 into kwkam-patch-2 2016-02-13 17:13:25 +09:00
kwkam 04eacf05e7 Update WinConsoleFile.cc
add blank line
2016-02-13 16:03:41 +08:00
kwkam 1c573c9708 src/WinConsoleFile.cc: fix colour
Try to make it less confusing
2016-02-13 16:01:41 +08:00
Tatsuhiro Tsujikawa c245c5ecc6 Fix compile error with clang and --enable-werror 2016-02-13 16:33:47 +09:00
kwkam 25ae17b490 src/WinConsoleFile.cc: fix colour
Set default foreground/background colour correctly
2016-02-12 14:24:04 +08:00
Tatsuhiro Tsujikawa 5e48e01bf9 Don't inherit file descriptor to child process
For non-Mingw32 build, set FD_CLOEXEC to file descriptors which live
beyond function scope.  For Mingw32 build, just pass false to
bInheritHandles parameter of CreateProcessW.
2016-02-08 00:09:17 +09:00
Tatsuhiro Tsujikawa 25615fcb17 Add "seeder" key to tellStatus RPC response 2016-02-03 22:21:37 +09:00
Tatsuhiro Tsujikawa 2a4d39b7e8 Don't add C++11 switch flags to CXXFLAGS 2016-01-30 19:14:38 +09:00
Tatsuhiro Tsujikawa e4d4eabd85 Use std::make_unique if C++14 is used 2016-01-30 19:13:41 +09:00
Tatsuhiro Tsujikawa cf2fa33fe0 WinTLS: Fix hang because of buffered received data
WinTLSSession buffers received decrypted data into its own buffer.  If
read is requested, it copies the data from its buffer.  But if
requested buffer size is less than decrypted buffer, some of the data
is left in the buffer.  Previously, we had no facility to check the
existence of this pending data.  If this data is the last requested
data from remote server, we may end up waiting for read event even if
we have already data in our buffer, which may cause hang.  This commit
fixes this issue by introducing function to return the buffered length
in TLSSession.  SocketCore also provides the same function, which
delegates to TLSSession object.
2016-01-30 00:17:54 +09:00
Tatsuhiro Tsujikawa 8f51793b19 Add --max-mmap-limit option
Set the maximum file size to enable mmap (see --enable-mmap
option). The file size is determined by the sum of all files contained
in one download. For example, if a download contains 5 files, then
file size is the total size of those files. If file size is strictly
greater than the size specified in this option, mmap will be disabled.
2016-01-29 00:14:30 +09:00
Tatsuhiro Tsujikawa fc95a91eb6 mingw: Use SetFileValidData to make --file-allocation=falloc work 2016-01-28 23:15:04 +09:00
Tatsuhiro Tsujikawa 25243da039 mingw: Add formatLastError as wrapper function for FormatMessage 2016-01-28 22:25:46 +09:00
Tatsuhiro Tsujikawa ad6d799b98 Retry with 504 status code 2016-01-26 15:49:05 +09:00
Tatsuhiro Tsujikawa 8203ee3d0d Increase DHT transaction ID from 2 to 4 bytes to avoid conflict 2016-01-23 12:39:42 +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 6da1e9989c migw: Fix build failure 2016-01-22 22:19:55 +09:00
Tatsuhiro Tsujikawa d648062851 Replace sourforge reference to the new site 2016-01-22 09:09:58 +09:00
Tatsuhiro Tsujikawa 5892291c55 clang-format-3.6 2016-01-21 23:16:58 +09:00
Tatsuhiro Tsujikawa aaab5bbc74 Improve error message when loading pkcs12 file failed 2016-01-21 23:13:13 +09:00
Tatsuhiro Tsujikawa 8b93b12488 Reduce delay in tracker request
We eliminated 1 second delay between completion of name resolution for
tracker request and time when it is actually issued.  We also elimited
1 second delay after last torrent download exists and it is told to
DHTInteractionCommand.
2016-01-19 11:24:57 +09:00
Tatsuhiro Tsujikawa 7b2e797fdf Disable IPv6 on non-async NameResolver if configuration wants 2016-01-19 10:50:21 +09:00
Tatsuhiro Tsujikawa ffec92ec57 Fix mysterious 1 second delay with async DNS 2016-01-19 10:42:25 +09:00
Tatsuhiro Tsujikawa e6b6aa324b UDP tracker: Log transaction ID and connection ID in hex string 2016-01-19 00:24:21 +09:00
Tatsuhiro Tsujikawa dd678b7c65 UDP tracker: Use unsigned integer for transaction ID and connection ID 2016-01-18 23:47:31 +09:00
Tatsuhiro Tsujikawa ddb94ebdac Fix bug that UDP port was incorrectly used in UDP tracker announce request 2016-01-18 23:29:07 +09:00
Tatsuhiro Tsujikawa 9b41970134 Don't use std::random_device directly as suggested by document
See http://en.cppreference.com/w/cpp/numeric/random/random_device
2016-01-17 17:30:36 +09:00
Tatsuhiro Tsujikawa 0282899bfa Fix compile error 2016-01-16 21:21:16 +09:00
Tatsuhiro Tsujikawa aa06a17fda Refactor HttpRequest
This also makes comparison performed when replacing builtin header
field with user-defined one case-insensitive.
2016-01-10 16:59:31 +09:00
Tatsuhiro Tsujikawa bf9d99f291 Send Want-Digest as per RFC 3230 2016-01-10 16:10:57 +09:00
Tatsuhiro Tsujikawa ea4d99ea08 Refactor SocketCore::getPeerInfo, getAddrInfo to return Endpoint object 2016-01-09 18:17:04 +09:00
Tatsuhiro Tsujikawa e899eba76f Define SockAddr and use it instead of raw std::pair 2016-01-09 17:20:03 +09:00
Tatsuhiro Tsujikawa d2d06395d9 Try all found address set to bind sockets with --multiple-interface
Fixes GH-523
2016-01-09 14:06:09 +09:00
Tatsuhiro Tsujikawa 8246fd1ff5 Updating upload size and speed must be done separately 2016-01-05 16:23:58 +09:00
Tatsuhiro Tsujikawa b1132d6b10 make clang-format using clang-format-3.6 2015-12-27 18:40:08 +09:00
Tatsuhiro Tsujikawa 4abad2f64c Exclude src/usage_text.h from clang-format 2015-12-27 18:36:36 +09:00
Tatsuhiro Tsujikawa 22e18e5983 Fix compile error on travis 2015-12-26 21:08:06 +09:00
Tatsuhiro Tsujikawa d0ccb39880 Add system.listMethods RPC method
system.listMethods just returns the available RPC method names.  It
can be executed without secret token, because it just returns the
method names, and does not alter anything.

See GH-437
2015-12-26 20:58:42 +09:00
Tatsuhiro Tsujikawa b9435f8786 Clean up 2015-12-26 19:03:50 +09:00
Tatsuhiro Tsujikawa 0a63a7ecc3 Add clang-format
Use clang-format-3.6 for now.
2015-12-23 18:00:49 +09:00
Tatsuhiro Tsujikawa bc1c9cae00 Cleanup 2015-12-23 17:34:09 +09:00