Tatsuhiro Tsujikawa
f75402739b
Rewritten ServerStatMan::load() using nothrow version of parseInt
2012-09-27 00:07:15 +09:00
Tatsuhiro Tsujikawa
8f2030da09
Removed HttpHeader::findAs{LL}Int and unused HttpResponse::{has,get}RetryAfter
2012-09-26 23:58:59 +09:00
Tatsuhiro Tsujikawa
b9f972665b
Rewritten LpdMessageReceiver::receiveMessage()
2012-09-26 23:45:58 +09:00
Tatsuhiro Tsujikawa
3a917ff695
Rewritten FtpConnection::receiveMdtmResponse without util::parseInt
2012-09-26 23:14:49 +09:00
Tatsuhiro Tsujikawa
10a68061f7
Code cleanup
2012-09-26 23:03:25 +09:00
Tatsuhiro Tsujikawa
a20e279606
Use std::string for SocketPoolEntry::options_
...
Currently, we only store 1 value for FTP download. std::map is
overkill in the this situation.
2012-09-26 23:00:05 +09:00
Tatsuhiro Tsujikawa
c13dc166de
Rewritten ExtensionMessageRegistry
2012-09-26 22:02:48 +09:00
Tatsuhiro Tsujikawa
f0000a8754
Made ExtensionMessage's NAME const char[]
2012-09-26 00:01:41 +09:00
Tatsuhiro Tsujikawa
c522d79d89
Code cleanup
2012-09-25 23:48:35 +09:00
Tatsuhiro Tsujikawa
f133091a9e
Made BufferedFile ctor take const char* args
2012-09-25 23:44:41 +09:00
Tatsuhiro Tsujikawa
c63af24c63
Made BtMessage's NAME const char[]
2012-09-25 23:28:24 +09:00
Tatsuhiro Tsujikawa
9a510ddac0
Made MetalinkMetaurl::MEDIATYPE_TORRENT const char[]
2012-09-25 23:07:23 +09:00
Tatsuhiro Tsujikawa
8788cae7e3
Removed MetalinkResource static strings
2012-09-25 23:03:19 +09:00
Tatsuhiro Tsujikawa
be77d1394e
Removed Request::PROTO_*
2012-09-25 22:41:03 +09:00
Tatsuhiro Tsujikawa
c186e93488
Code cleanup
2012-09-25 22:02:58 +09:00
Tatsuhiro Tsujikawa
c16cebbc9a
Code cleanup
2012-09-25 22:00:56 +09:00
Tatsuhiro Tsujikawa
41cb774374
Made getMethodName() of RpcMethod subclass return const char*
2012-09-25 21:57:08 +09:00
Tatsuhiro Tsujikawa
260a0b8bcb
Rewritten AnnounceList::getEventString()
2012-09-25 00:07:14 +09:00
Tatsuhiro Tsujikawa
b640b830a2
Made STATUS_STRING const char*[]
2012-09-25 00:01:00 +09:00
Tatsuhiro Tsujikawa
a8c0794640
Made DEFAULT_STRIP_CHARSET const char[]
2012-09-24 23:54:41 +09:00
Tatsuhiro Tsujikawa
656a766bb0
Rewritten ServerStatMan::load()
2012-09-24 23:35:41 +09:00
Tatsuhiro Tsujikawa
d8c44fe9e8
Use const char* instead of static const std::string
2012-09-24 23:20:43 +09:00
Tatsuhiro Tsujikawa
0144397e4b
Rewritten File::getPathSeparators()
2012-09-24 23:04:42 +09:00
Tatsuhiro Tsujikawa
d95a179876
Removed A2STR strings other than NIL
2012-09-24 23:01:08 +09:00
Tatsuhiro Tsujikawa
4423ece43d
Moved GZipDecoder to test
2012-09-24 22:38:59 +09:00
Tatsuhiro Tsujikawa
dc74ebeced
Removed unused code
2012-09-24 21:46:26 +09:00
Tatsuhiro Tsujikawa
8d8ba403fe
Removed proxy-connection from InterestingHeader
2012-09-23 22:33:15 +09:00
Tatsuhiro Tsujikawa
8b0bdacace
Don't send Proxy-Connection header field
...
It was deprecated long ago.
2012-09-23 21:51:53 +09:00
Tatsuhiro Tsujikawa
54665ff409
Removed static std::string constant in HttpHeader
...
This change also removes inspection of Proxy-Connection header field
when checking whether the remote endpoint keeps connection open.
2012-09-23 21:46:01 +09:00
Tatsuhiro Tsujikawa
dd7014a612
Store only interesting HTTP headers in HttpHeader
...
In this change, we defined HTTP header fields we are interested in.
We only store those headers in HttpHeader object. Accessing HTTP
headers in HttpHeader object is now done through enum values.
2012-09-23 20:59:34 +09:00
Tatsuhiro Tsujikawa
0b4dec0250
Increased shreshold of command-line option suggestion
2012-09-23 15:06:39 +09:00
Tatsuhiro Tsujikawa
295a62f538
Rewritten help tags and various internal flag handling in OptionHandler
...
Now help tags are defined as enum values to avoid vector of strings.
The internal flags are represented by bitmask to shrink size.
2012-09-23 14:59:05 +09:00
Tatsuhiro Tsujikawa
461a542c5e
Rewritten DownloadHandlerConstants
...
DownloadHandlerConstants was simplified. MIME type handling in Accept
header was also reworked. DownloadContext's metalinkServerContacted_
is replaced with acceptMetalink_ and its boolean value is reverted.
RequestGroup and HttpRequest now do not hold vector of accepting
types. HttpRequest has the flag acceptMetalink_ which will be set by
the same value of DownloadContext::accpetMetalink_ and if it is true,
Metalink MIME types are added to Accept header field.
2012-09-22 23:19:41 +09:00
Tatsuhiro Tsujikawa
9d294741fd
Rewritten FeatureConfig into set of functions
2012-09-22 20:56:39 +09:00
Tatsuhiro Tsujikawa
e2340efe27
Use std::vector instead of std::map for ContextAttribute objects
...
Now key for ContextAttribute object store is int instead of string.
2012-09-22 17:37:30 +09:00
Tatsuhiro Tsujikawa
0030025bb6
Don't set SNI hostname if it does not include "." for GNUTLS
2012-09-15 01:14:21 +09:00
Tatsuhiro Tsujikawa
393d0d9fbc
Disable SSL/TLS compression with OpenSSL
2012-09-15 01:13:52 +09:00
Tatsuhiro Tsujikawa
d0703a2f26
Code cleanup
2012-09-07 21:45:36 +09:00
Tatsuhiro Tsujikawa
763c7a0aa0
Pause download even if download is completed
...
This allows to pause and unpause BitTorrent seed.
2012-09-07 01:40:40 +09:00
Tatsuhiro Tsujikawa
f6c7aaa1cd
Use execlp() instead of execl()
2012-09-07 01:28:53 +09:00
Tatsuhiro Tsujikawa
2148cbaf1d
Fixed compile error without XML library
2012-09-02 21:04:36 +09:00
Tatsuhiro Tsujikawa
e2bf627b17
Ensure that num of commands is 0 before processing tracker response
2012-09-02 17:43:26 +09:00
Tatsuhiro Tsujikawa
3c39931566
Remove trailing white spaces
2012-09-02 17:40:11 +09:00
Tatsuhiro Tsujikawa
2a51949132
Catch exception from Socket::getPeerInfo() when pooling connection
...
Socket::getPeerInfo() may fail if its TCP connection has already
disconnected. In this case, we log this error. The success or failure
of pooling connection should not affect the later execution of the
program.
2012-09-02 17:35:50 +09:00
Tatsuhiro Tsujikawa
9840955798
Removed trailing white spaces
2012-09-01 20:54:07 +09:00
Tatsuhiro Tsujikawa
086c5701e1
Updated doc
2012-09-01 20:53:38 +09:00
Tatsuhiro Tsujikawa
ce5c016066
Cleared pre and post download handlers from BitTorrent tracker request
2012-09-01 00:53:30 +09:00
Tatsuhiro Tsujikawa
b336725ca0
Don't check control file existence if isPreLocalFileCheckEnabled() == false
2012-08-31 23:40:32 +09:00
Tatsuhiro Tsujikawa
0bbda43385
Fixed assertion error if --retry-wait is used
...
In CreateRequestCommand, if Request object returned from getRequest()
is still sleeping, CreateRequestCommand pools it back but still holds
its reference. This makes assertion error in
UnknownLengthPieceStroage::hasMissingUnusedPiece() from
AbstractCommand::execute().
2012-08-31 22:31:31 +09:00
Tatsuhiro Tsujikawa
d734ff7d29
Added new file allocation method called 'trunc'
...
--file-allocation option can now take new value 'trunc'. 'trunc' uses
ftruncate() system call or platform-specific counterpart to truncate a
file to a specified length.
2012-08-12 16:52:53 +09:00
Tatsuhiro Tsujikawa
e2fcd6d72c
Use enum to select file allocation method
2012-08-11 23:38:58 +09:00
Tatsuhiro Tsujikawa
8f1049c15f
Fixed assertion in removeRequestGroupIndex()
2012-08-03 00:27:03 +09:00
Tatsuhiro Tsujikawa
2795176d79
Add GID => RequestGroup index for faster access to RequestGroup
2012-07-31 23:55:51 +09:00
Tatsuhiro Tsujikawa
329a17b3f9
Removed tailing whitespaces
2012-07-31 21:26:59 +09:00
Tatsuhiro Tsujikawa
3465906969
Added missing sources to SRCS
2012-07-30 22:31:09 +09:00
Tatsuhiro Tsujikawa
c1ddf34e4b
Specify torrent file explicitly in createRequestGroupForBitTorrent()
2012-07-26 21:20:08 +09:00
Tatsuhiro Tsujikawa
01e1fdaf49
Parse torrent file on the fly if --follow-torrent=mem is given
...
In this changes, Bencode parser in bencode2 is removed and the request
is delegated to BencodeParser.
2012-07-26 21:07:10 +09:00
Tatsuhiro Tsujikawa
7176107414
BencodeParser: fixed parser failure due to the uninitialized variables
2012-07-26 20:42:02 +09:00
Tatsuhiro Tsujikawa
8311d6ef87
Added stream Bencode parser
2012-07-24 23:50:06 +09:00
Tatsuhiro Tsujikawa
9620bb0a6d
Fix off by 1 error in JsonParser::parseUpdate() return value
2012-07-24 23:47:18 +09:00
Tatsuhiro Tsujikawa
2684db766d
Fix Android build
2012-07-24 00:05:18 +09:00
Tatsuhiro Tsujikawa
f6b2c3c080
Rewritten ExpatXmlParser
...
Put common elements in both Xml2XmlParser and ExpatXmlParser in
XmlParser.
2012-07-23 23:41:33 +09:00
Tatsuhiro Tsujikawa
4b57106a17
Check sum of file length does not exceed INT64_MAX
...
With BitTorrent or Metalink (metaurl), one RequestGroup can contain
multiple files. In this change, ensure that the sum of thoese files
must be equal or less than INT64_MAX.
2012-07-23 21:57:02 +09:00
Tatsuhiro Tsujikawa
860f4dd06a
Use int64_t instead of off_t
...
Using off_t, at least, in DiskAdaptor layer is problematic because
torrent can contain under 2GiB files but total sum of those files may
exceed 2GiB limit, which makes off_t overflow in 32 bit system without
large file support. So we use int64_t in API. We'll check the file
length before download so that it does not exceed max off_t.
2012-07-23 21:42:47 +09:00
Tatsuhiro Tsujikawa
f56743b083
Parse WebSocket RPC request on the fly without buffering
2012-07-15 00:24:59 +09:00
Tatsuhiro Tsujikawa
7100b1b9ca
Parse HTTP RPC request on the fly without buffering
2012-07-14 18:59:56 +09:00
Tatsuhiro Tsujikawa
5352d76d4f
Added reset() API to ParserStateMachine
...
Not unittested
2012-07-13 00:53:56 +09:00
Tatsuhiro Tsujikawa
70685bd233
Rewritten Xml2XmlParser
...
Now it is push parser + utility function for file parsing.
2012-07-11 23:20:48 +09:00
Tatsuhiro Tsujikawa
cd67e27ca4
Check structure depth when parsing JSON
2012-07-11 23:20:20 +09:00
Tatsuhiro Tsujikawa
57b46d5123
Added streaming parser for structured data format.
...
Added JSON streaming parser. Note that currently JSON parser ignores
frac and exp parts of number construct.
2012-07-10 01:42:42 +09:00
Tatsuhiro Tsujikawa
e3b8c92434
Added TLS SNI support
2012-07-06 23:07:10 +09:00
Tatsuhiro Tsujikawa
b00ed1aa30
More http header parser tests
2012-07-06 00:57:18 +09:00
Tatsuhiro Tsujikawa
f04090199f
Rewritten timegm replacement function
...
The algorithm is based on Python 2.7 calendar.timegm.
2012-07-06 00:34:37 +09:00
Tatsuhiro Tsujikawa
4046f27ea9
Use system-wide certificates for SSL
...
Use system-wide certificates for SSL. For GnuTLS it requires the
latest version, 3.0.20. OpenSSL had it for longer. This means that if
SSL library is properly configured to locate system-wide certificates
store, the user don't have to use --ca-certificate option. Also
packagers don't have to use --with-ca-bundle configure option.
Patch from Cristian Morales Vega
2012-07-05 23:22:34 +09:00
Tatsuhiro Tsujikawa
b25d8a9923
Code cleanup
2012-07-04 22:59:15 +09:00
Tatsuhiro Tsujikawa
995c07c184
Fixed base64::decode() return "" if input ends with garbase and no padding
2012-07-04 22:51:41 +09:00
Tatsuhiro Tsujikawa
aa944f4ef6
Guarded include of stdint.h and inttypes.h
2012-07-04 00:00:24 +09:00
Tatsuhiro Tsujikawa
98e1c6c580
Code cleanup
2012-07-03 21:56:26 +09:00
Sergey Zolotarev
1c39b9474e
Fixed ssize_t error on MinGW
2012-07-03 17:44:48 +06:00
Tatsuhiro Tsujikawa
5d3b6801b1
Changed default Peer ID prefix
...
The new Peer ID prefix is "A2-$MAJOR-$MINOR-$MICRO-", where $MAJOR,
$MINOR and $MICRO are the major version, the minor version and the
micro version respectively. For instance, 1.15.2 release of aria2 will
use "A2-1-15-2-".
2012-06-29 23:38:12 +09:00
Tatsuhiro Tsujikawa
0c8ec9c325
Merged Android build scripts
2012-06-29 00:51:13 +09:00
Tatsuhiro Tsujikawa
f1017d5def
Don't percent-decode filename value in Content-Disposition.
...
We only percent-decode filename* value in Content-Disposition because
the encoding is fully specified. But since filename value is not, so
we just accept it as is.
2012-06-28 23:18:50 +09:00
Tatsuhiro Tsujikawa
c30ea8adeb
Don't sum in-flight piece which does not intersect filtered ranges
...
When calculating completed length, don't sum the completed length of
piece which does not intersect filtered ranges.
2012-06-27 23:28:57 +09:00
Tatsuhiro Tsujikawa
68f225de0b
Use stack allocation+reference instead of pointer for BufferedFile
2012-06-27 01:38:27 +09:00
Tatsuhiro Tsujikawa
a6775db3ca
Fixed segmentation fault when logger failed to open log file
2012-06-27 01:38:18 +09:00
Tatsuhiro Tsujikawa
16d395779a
Removed static_cast<int64>()s where they are unnecessary
2012-06-25 23:44:52 +09:00
Tatsuhiro Tsujikawa
1b874268a0
Use int64_t instead of off_t
...
Some classes such as DiskAdaptor, DiskWriter, FileAllocationIterator
and ChecksumValidator are left unchanged.
2012-06-25 23:35:24 +09:00
Tatsuhiro Tsujikawa
4b03634f36
Use PRId64 for int64_t format specifier
2012-06-25 22:43:33 +09:00
Tatsuhiro Tsujikawa
3620d271af
Process as many messages as possible in recv buffer
2012-06-25 21:37:55 +09:00
Tatsuhiro Tsujikawa
e816c5eee4
Rewritten PeerConnection::receiveMessage()
...
The old implementation calls at least 2 read(2) (4bytes length and
payload) to receive the message. This change will read as many bytes
as possible in one read(2) call. BtPieceMessage::data_ is now just a
const pointer to the internal buffer of PeerConnection.
2012-06-25 21:35:52 +09:00
Tatsuhiro Tsujikawa
73b75186c7
Handle the case when MINGW32 vsnprintf returns -1
...
MINGW32 vsnprintf returns -1 if output is truncated. Increased buffer
for vsnprintf in WinConsoleFile and fmt.
2012-06-24 16:56:34 +09:00
Tatsuhiro Tsujikawa
96720b297d
Added --enable-mmap option.
...
If this option is used, map files into memory using mmap(2). This
option is experimental.
2012-06-24 16:28:04 +09:00
Tatsuhiro Tsujikawa
38426d744b
Code cleanup
2012-06-23 17:50:27 +09:00
Tatsuhiro Tsujikawa
5fc1b1ad29
Rewritten HTTP header parser
2012-06-23 17:34:20 +09:00
Tatsuhiro Tsujikawa
5a0a62c5f4
Added CORS preflight request support.
...
This change is based on the patch from binux.
2012-06-23 16:26:17 +09:00
Tatsuhiro Tsujikawa
9ba65aea1d
Rewritten ChunkedDecodingStreamFilter
2012-06-18 23:42:46 +09:00
Tatsuhiro Tsujikawa
afcd95dec7
Return appropriate HTTP status code on RPC failure.
...
In this change, we return 404 if the request path is neither /json-rpc
nor /rpc. If XML feature is not enabled and /rpc is requested, return
404. If XML parser failed, return 400. JSON parser failure has been
handled well in the existing code.
2012-05-19 18:36:57 +09:00
Tatsuhiro Tsujikawa
68eb1b6737
Ignore unacceptable options in RPC request instead of throwing error.
...
This change allows RPC client to send same options for the different
type of downloads.
2012-05-17 22:52:39 +09:00
Tatsuhiro Tsujikawa
92c518a2ba
Moved parseAsyncDNSServers() to AsyncNameResolver.cc and refactored.
...
The parseAsyncDNSServers() now uses net::getBinAddr() internally,
which makes the function simpler. Also added unit test.
2012-05-16 23:05:09 +09:00
Tatsuhiro Tsujikawa
36051cca5e
Handle sockaddr_in.sin_len and sockaddr_in6.sin6_len
...
Check sockaddr_in.sin_len and sockaddr_in6.sin6_len are available and
assign values to them properly. This change fixes unit test error and
most error related to getnameinfo() on netbsd.
2012-05-16 22:43:25 +09:00
Tatsuhiro Tsujikawa
ca60020fa4
Removed dependency on inet_aton
...
Implemented inetPton as a replacement of inet_aton. inetPton is
implemented using net::getBinAddr.
This change fixes bug#3525424.
2012-05-14 01:17:50 +09:00
Tatsuhiro Tsujikawa
19798f09ae
Fixed typo
2012-05-12 19:33:33 +09:00
Tatsuhiro Tsujikawa
a998e32f95
Call ERR_clear_error() before OpenSSL I/O functions.
...
Use ERR_get_error() with ERR_error_string().
2012-05-08 01:02:18 +09:00
Tatsuhiro Tsujikawa
d16071d108
Fixed the bug which prevents --bt-lpd-interface from working.
...
Fixes bug#3520125
2012-04-22 18:35:43 +09:00
Tatsuhiro Tsujikawa
f5d3cd1bb0
Updated copyright year
2012-04-08 21:43:00 +09:00
Tatsuhiro Tsujikawa
aee28c8b0d
Fixed compile warning with clang
2012-04-08 19:22:23 +09:00
Tatsuhiro Tsujikawa
1e0068e4d4
WebSocket: Check keyword string in comma separeted values in HTTP
...
header field.
2012-04-08 19:00:07 +09:00
Tatsuhiro Tsujikawa
c648ca0c5c
Include common.h from a2algo.h and a2functional.h
2012-04-08 18:59:06 +09:00
Tatsuhiro Tsujikawa
52826433d9
Fixed typo
2012-04-08 17:51:01 +09:00
Tatsuhiro Tsujikawa
9e8676af2c
Disable IPv6 by default only if MinGW 32bit build.
2012-04-08 17:45:33 +09:00
Tatsuhiro Tsujikawa
d9bb24a2e0
Fixed gcc-4.7 warnings
2012-04-08 03:12:29 +09:00
Tatsuhiro Tsujikawa
fcbdecfd1e
Conditional compile for WebSocket.
...
WebSocket support depends on Message Digest support.
2012-04-08 00:50:25 +09:00
Tatsuhiro Tsujikawa
7bc2a14d9f
Fixed compile error without BitTorrent support
2012-04-08 00:05:42 +09:00
Tatsuhiro Tsujikawa
ef86d760cc
Use CreateProcessW instead of CreateProcessA
2012-04-07 23:57:49 +09:00
Tatsuhiro Tsujikawa
3f7561b80c
Define HAVE_GETADDRINFO only if it is not defined in MinGW build.
2012-04-07 23:56:37 +09:00
Tatsuhiro Tsujikawa
fcb102b650
Fixed compile error with i686-w64-mingw32
2012-04-07 21:26:33 +09:00
Tatsuhiro Tsujikawa
840ca5adb6
Check availability of pwd.h
2012-04-07 15:49:22 +09:00
Tatsuhiro Tsujikawa
c7c26e67c4
Disable IPv6 for MinGW build by default
2012-04-07 15:40:33 +09:00
Tatsuhiro Tsujikawa
65a20f5070
First check there is wildcard character or not in tls hostname check.
2012-04-01 22:07:01 +09:00
Tatsuhiro Tsujikawa
b9471d7452
Compare IPAddress in commonName as string.
...
Added test for net::verifyHostname().
2012-04-01 16:42:38 +09:00
Tatsuhiro Tsujikawa
b68e0a5527
Use net::verifyHostname() with gnutls.
...
We now don't use gnutls_x509_crt_check_hostname() any more.
2012-03-31 21:21:18 +09:00
Tatsuhiro Tsujikawa
e6f04416d9
Don't use locale dependent toupper and tolower.
2012-03-31 00:06:55 +09:00
Tatsuhiro Tsujikawa
0a9abd89c6
Rewritten TLS hostname check based on RFC 6125.
2012-03-30 23:49:14 +09:00
Tatsuhiro Tsujikawa
e4e9562c92
Get the home directory of the effective user ID using getpwuid() if
...
$HOME is not defined.
2012-03-30 01:43:38 +09:00
Tatsuhiro Tsujikawa
25ef6677e9
Added hostname check described in RFC 2818 with OpenSSL.
2012-03-28 23:28:22 +09:00
Tatsuhiro Tsujikawa
06b6bef860
Made WebSocket handshake more strict.
...
Refactored HttpServer as well.
2012-03-25 22:10:36 +09:00
Tatsuhiro Tsujikawa
8499a47d21
Added --bt-remove-unselected-file option.
...
Removes the unselected files when download is completed in
BitTorrent. To selecting files, use --select-file option. If it is not
used, all files are assumed to be selected. Please use this option
with care because it will actually remove files from your disk.
This option is default to false.
2012-03-25 19:25:43 +09:00
Tatsuhiro Tsujikawa
2b3469dad9
Use std::set for socketEntries_ and nameResolverEntries_ in PortEventPoll
2012-03-25 00:38:57 +09:00
Tatsuhiro Tsujikawa
ae393329f7
Fixed segmentation fault in open solaris in unit test.
...
This is due to the fact that the maximum value of random() in open
solaris is not RAND_MAX, but (2**31)-1.
2012-03-25 00:28:11 +09:00
Tatsuhiro Tsujikawa
4d8c17d104
Fixed compile error on open solaris
...
Fixes bug#3497518
2012-03-25 00:27:25 +09:00
Tatsuhiro Tsujikawa
d8948056b3
Use std::set for socketEntries_ and nameResolverEntries_ in KqueueEventPoll
2012-03-24 21:19:57 +09:00
Tatsuhiro Tsujikawa
eed804baaa
Use std::set instead of std::deque if the elements are sorted and
...
insertions and deletions are frequent.
2012-03-23 01:34:37 +09:00
Tatsuhiro Tsujikawa
332bda83b4
Enable TCP_NODELAY for WebSocket connection.
2012-03-21 02:08:18 +09:00
Tatsuhiro Tsujikawa
0792540bf2
Prefixed notification method name with "aria2."
2012-03-21 01:35:48 +09:00
Tatsuhiro Tsujikawa
f4e2c7f060
Added JSON-RPC over WebSocket.
...
Wslay library must be placed under deps/wslay.
2012-03-20 21:42:09 +09:00
Tatsuhiro Tsujikawa
5bff877eae
Fixed assertion failure if Chunked encoding along with Content-Length is used.
2012-03-05 12:45:05 +09:00
Tatsuhiro Tsujikawa
e73c3c53ff
Fixed clang warning and errors.
...
Test for the zero-length array with A2_ARRAY_LEN was commented out
since it is only used in unit test code and clang and old gcc 3.4.3
emit error.
2012-03-01 00:02:29 +09:00
Tatsuhiro Tsujikawa
037f1512db
Added BufferedFile::getLine() to make reading one line more flexible.
...
Fixes bug#3495336
2012-02-29 02:50:12 +09:00
Tatsuhiro Tsujikawa
c63a524a88
Added .gitignore files
2012-02-27 21:49:01 +09:00
Tatsuhiro Tsujikawa
f4e0eae904
Added checkRequiredInteger() to check integer param is in valid range.
...
Ensure that fileIndex in aria2.changeUri RPC method is greater than or
equal to 1.
2012-02-26 21:49:37 +09:00
Tatsuhiro Tsujikawa
ad11d746f0
Only accepts 32 bit integer values from int and i4 elements in XML-RPC.
...
Fixed overflow in AbstractPaginationRpcMethod::getPaginationRange().
Fixes bug#3494165
2012-02-26 19:45:25 +09:00
Tatsuhiro Tsujikawa
663cfec9f6
Fixed the bug that aria2 does not listen on address given in --interface.
2012-02-22 22:45:01 +09:00
Tatsuhiro Tsujikawa
075ea06ad7
Supported Windows UNC path.
2012-02-19 21:19:11 +09:00
Tatsuhiro Tsujikawa
b7dbcea58b
Check scheme part in redirected URI more strictly.
...
The previous implementation mistakenly sees '/abspath?uri=http://foo '
as an absolute URI because it contains '://', but actually it is not.
This change checks scheme part is constructed in the allowed character
set described in RFC 3986 Section 3.1.
2012-02-15 01:40:12 +09:00
Tatsuhiro Tsujikawa
9e302b86df
Code cleanup: use empty() to check size() == 0
2012-02-12 23:21:25 +09:00
Tatsuhiro Tsujikawa
7dc2b9ff16
Allow missing params in XML-RPC request.
...
Now following request is legal:
<methodCall>
<methodName>aria2.getVersion</methodName>
</methodCall>
2012-02-12 23:13:21 +09:00
Tatsuhiro Tsujikawa
9b7e4219d9
Reserve PeerConnection's buffer capacity according to number of pieces.
...
If the number of pieces gets bigger, the length of Bitfield message
payload exceeds the initial buffer capacity of PeerConnection, which
is MAX_PAYLOAD_LEN. We expand buffer as necessary so that
PeerConnection can receive the Bitfield message.
2012-02-09 01:51:42 +09:00
Tatsuhiro Tsujikawa
f2d55f0edc
Added --deferred-input option.
...
If true is given to --deferred-input option, aria2 does not read all
URIs and options from file specified by -i option at startup, but it
reads one by one when it needs later. This may reduce memory usage if
input file contains a lot of URIs to download. If false is given,
aria2 reads all URIs and options at startup. This option defaults to
false.
2012-02-05 18:57:16 +09:00
Tatsuhiro Tsujikawa
a6803c21b5
Support network-path reference in HTTP redirect.
2012-01-11 02:17:38 +09:00
Tatsuhiro Tsujikawa
2997fa0631
Refactored splitNsName
2012-01-11 02:04:20 +09:00
Tatsuhiro Tsujikawa
3b1834e633
Avoid strlen in util::streq, util::strieq, util::startsWith and util::istartsWith
2012-01-11 01:50:35 +09:00
Tatsuhiro Tsujikawa
b340c25164
Code cleanup
2012-01-11 01:23:24 +09:00
Tatsuhiro Tsujikawa
b6fd4366fe
Use short form of util::startsWith and util::endsWith
2012-01-11 01:17:51 +09:00
Tatsuhiro Tsujikawa
9331f6a43d
Removed static const char[] as much as possible.
...
Provided convenient functions for streq, strieq, startsWith,
istartsWith, endsWith, iendsWith to support this move.
2012-01-11 01:03:38 +09:00
Tatsuhiro Tsujikawa
db86ffbca9
Fixed compile error without libnettle, libgcrypt and openssl
2012-01-08 19:10:55 +09:00
Tatsuhiro Tsujikawa
1c292f469e
aria2 now doesn't assume download's completed just because file size matched
...
The only exception is zero-length file. If server tells file is
zero-length and --checksum option is given, aria2 now correctly checks
its checksum. There is one known issue: If downloaded file is
zero-length file and .aria2 file exists, it will not be deleted on
successful verification, because .aria2 file is not loaded.
2012-01-08 17:46:03 +09:00
Tatsuhiro Tsujikawa
b6f8a3dbb3
Use std::ifstream instead of file descriptor for generateRandomDataUrandom()
...
Usually required random bytes are short, it is advantageous to use
std::ifstream which is buffered I/O rather than read() syscall.
2012-01-08 01:21:42 +09:00
Tatsuhiro Tsujikawa
46e59c4cc3
Fixed the bug that --checksum is not working.
2012-01-08 01:15:58 +09:00
Tatsuhiro Tsujikawa
4ff29f802f
Moved PeerConnection.{h,cc} to BitTorrent resources
2012-01-08 01:09:58 +09:00
Tatsuhiro Tsujikawa
63325cfd06
Fixed compile error without libnettle, libgcrypt and openssl.
2012-01-08 01:00:02 +09:00
Tatsuhiro Tsujikawa
e6c44871c8
Fixed the bug that log file is not created if there is warning before log open
...
Use LogFactory::reconfigure() to reopen log file after setting log
filename from option.
2011-12-27 17:14:29 +09:00
Tatsuhiro Tsujikawa
973e0df748
Fixed compile error on openbsd
2011-12-26 01:00:15 +09:00
Tatsuhiro Tsujikawa
deb0983ab4
Fixed compile error on android (which does not LFS support)
2011-12-26 00:10:27 +09:00
Tatsuhiro Tsujikawa
52155b1860
No retry for close() with EINTR. Also reverted changes in d5ffa253
.
2011-12-25 23:38:36 +09:00
ITriskTI
aa070bc683
Update src/version_usage.cc
2011-12-12 16:09:45 +03:00
Tatsuhiro Tsujikawa
d4e9b07719
Fixed compile error without BitTorrent support
2011-12-11 03:13:33 +09:00
Tatsuhiro Tsujikawa
c8191700b1
Fixed compile error without BitTorrent and Metalink support
2011-12-11 00:08:13 +09:00
Tatsuhiro Tsujikawa
8fe92517d9
Removed deleted source file entry
2011-12-10 19:26:36 +09:00
Tatsuhiro Tsujikawa
3637291c22
Fixed compile warning/error with mingw32
2011-12-10 19:06:09 +09:00
Tatsuhiro Tsujikawa
ebc082747c
Log filename in the exception when AbstractDiskWriter::closeFile() failed.
2011-12-10 18:03:30 +09:00
Tatsuhiro Tsujikawa
413b61c316
FTP PASV: fixed IPv6 support.
...
If fake FTP URI cannot be parsed (this should not happen), throw
exception.
2011-12-10 17:57:31 +09:00
Tatsuhiro Tsujikawa
d5ffa2532d
AbstractDiskWriter::closeFile(): Throw exception if close() failed.
...
~AbstractDiskWriter calles closeFile(), but suppresses exception.
MultiDiskAdaptor::closeFile() logs error if child
DiskWriter::closeFile() throws exception. This exception is not
rethrown. If at least one exception is caught,
MultiDiskAdaptor::closeFile() throws new DlAbortEx.
RequestGroupMan::closeFile() just logs exception and suppress each
exception. Generally, don't call closeFile() in destructor. If you
need to call it, it must suppress the exception.
2011-12-09 23:32:38 +09:00
Tatsuhiro Tsujikawa
9a6f88c162
Use util::itos() for signed integrals
2011-12-09 21:40:22 +09:00
Tatsuhiro Tsujikawa
31163c6785
Check totalLength of file is less than std::numeric_limits<off_t>::max()
...
If totalLength is larger than std::numeric_limits<off_t>::max(), throw
DownloadFailureException.
2011-12-09 21:39:43 +09:00
Tatsuhiro Tsujikawa
7989cd898d
Use int or int32_t instead of size_t where suitable
2011-12-09 21:39:43 +09:00
Tatsuhiro Tsujikawa
30e0e19e67
Code cleanup
2011-12-09 21:39:43 +09:00
Tatsuhiro Tsujikawa
f0bcfa822e
Use int instead of unsigned int where unsigned int is not needed.
2011-12-09 21:39:43 +09:00
Tatsuhiro Tsujikawa
b97a7c8ecf
Use int32_t for begin, length in RangeBtMessage
2011-12-09 21:39:43 +09:00
Tatsuhiro Tsujikawa
9d15d732ed
Use int32_t for piece length instead of size_t
2011-12-09 21:39:43 +09:00
Tatsuhiro Tsujikawa
12988e5282
Replaced uint64_t with off_t or int64_t.
...
Since off_t is int64_t with LFS, we cannot take advantage of extra
capacity of uint64_t.
2011-12-09 21:39:43 +09:00
Tatsuhiro Tsujikawa
f25e67b017
FTP pasv: Use request host when connecting server with http proxy.
2011-12-09 21:37:54 +09:00
Tatsuhiro Tsujikawa
2eed1c3914
Fixed bug which causes segmentation fault when bad piece is got.
2011-12-09 21:34:18 +09:00
Tatsuhiro Tsujikawa
9752704614
Cast size_t to unsigned long for %lu
2011-12-06 23:53:43 +09:00
Tatsuhiro Tsujikawa
1ff1505916
Fixed typo and code cleanup
2011-12-03 21:41:07 +09:00
Tatsuhiro Tsujikawa
53fd815111
Use binary search in BtDependency for efficiency.
2011-12-03 18:34:07 +09:00
Tatsuhiro Tsujikawa
d1bb828066
Ignore peer which possibly sent bad data in next few minuts.
...
In aria2, one piece is downloaded from several peers, so when hash
check failed for that piece, it cannot determine which peer(s) sent
bad data. So, we ignore peer who sent last block of data in random
minutes. We use randomized timeout because all peers get waken up at
the almost same time.
2011-12-03 18:12:31 +09:00
Tatsuhiro Tsujikawa
6bf696ca11
New help messages. Added suggestion for unknown/ambiguous options.
...
The help messages shown when argument error were redesigned and less
verbose now. When unknown or ambiguous option is given, show
suggestions like "Did you mean...". Some constant values related to
levenstein distance are borrowed from git help.c.
2011-12-03 16:30:00 +09:00
Tatsuhiro Tsujikawa
26d4ca8a6a
Made notice level log messages translatable
2011-12-02 22:38:53 +09:00
Tatsuhiro Tsujikawa
dd3f688743
Made some texts translatable
2011-12-02 22:00:48 +09:00
Tatsuhiro Tsujikawa
f860bf0d50
Use %lld to fomat a2_gid_t
2011-12-02 21:36:11 +09:00
Tatsuhiro Tsujikawa
bc9fb7cb65
Fixed bug in util::parseULLIntNoThrow()
2011-12-02 00:44:33 +09:00
Tatsuhiro Tsujikawa
11c5a13534
Return true if bits == 0 in util::inSameCidrBlock()
2011-12-02 00:27:14 +09:00
Tatsuhiro Tsujikawa
031f1199d7
Added const to Option::getTable()
2011-12-01 23:36:17 +09:00
Tatsuhiro Tsujikawa
f9dd59eebd
Added missing XmlParser::parseMemory() in ExpatXmlParser.cc
2011-12-01 23:34:14 +09:00
Tatsuhiro Tsujikawa
82e5318e35
Fixed compile error with mingw
2011-12-01 23:21:56 +09:00
Tatsuhiro Tsujikawa
b89bc8a6cb
Added --stop-with-process=PID option.
...
This feature stops application when process PID is not running. This
is useful if aria2 process is forked from a parent process. The parent
process can fork aria2 with its own pid and when parent process exits
for some reason, aria2 can detect it and shutdown itself.
The code which detects whether or not given process PID is running is
contributed by Emmanuel Engelhart.
2011-12-01 23:21:44 +09:00
Tatsuhiro Tsujikawa
27dda3c65c
Support IPv6 address for FTP via HTTP tunneling.
...
We use control connection address as data connection address, so we
don't need to store both address and port. We just store port in
PASV/EPSV response and use SocketCore::getPeerInfo() to get peer's
address when needed.
2011-11-14 23:19:37 +09:00
Tatsuhiro Tsujikawa
97a9242cbe
Proxy URI is now constructed in getProxyUri().
...
The previous implementation constructs proxy URI in OptionHandler but
it cannot handle with the situation when user, password and proxy URI
is given various order. Now we just set rules: username set in
--*-proxy-user overrides username in --*-proxy option, no matter in
any order username, password and proxy URI are parsed. Likewise,
password set in --*--proxy-passwd overrides password in --*-proxy
option.
2011-11-13 23:06:24 +09:00
Tatsuhiro Tsujikawa
c42dd7e755
Changed format of ETA.
...
Now no leading 0 is used. If hour part and/or min part is non-zero,
and sec part is 0, sec part is omitted, like this "1h3m".
2011-11-13 20:59:15 +09:00
Tatsuhiro Tsujikawa
1687741303
Use fmt instead of util::itos
2011-11-13 20:55:06 +09:00
Tatsuhiro Tsujikawa
9e5124eb11
Include trailing "/" in UriStruct::dir.
...
The duplicate "/"s in dir are not removed now.
2011-11-12 22:36:05 +09:00
Tatsuhiro Tsujikawa
c0dda6a0f7
Changed createSockPoolKey so that we can support IPv6 numeric address safely.
2011-11-12 21:31:14 +09:00
Tatsuhiro Tsujikawa
db5cc4db27
Don't append character to std::string.
2011-11-12 21:27:24 +09:00
Tatsuhiro Tsujikawa
5347efb967
Use fmt instead of using snprintf directly
2011-11-12 19:33:38 +09:00
Tatsuhiro Tsujikawa
0da2468d6b
Removed strappend
2011-11-12 19:24:38 +09:00
Tatsuhiro Tsujikawa
2e5d9b056f
Removed strconcat
2011-11-12 18:17:34 +09:00
Tatsuhiro Tsujikawa
c4e66390ac
Code cleanup
2011-11-12 17:13:43 +09:00
Tatsuhiro Tsujikawa
f1f1b991f1
Removed SocketBuffer::pushStrSwap.
2011-11-12 01:19:01 +09:00
Tatsuhiro Tsujikawa
f0f1cfab5c
Use util::strifind instead of std::toLower and std::string::find.
2011-11-12 01:13:55 +09:00
Tatsuhiro Tsujikawa
2f4393d17c
Rewritten parse*Int
2011-11-12 01:06:52 +09:00
Tatsuhiro Tsujikawa
226480ad60
Made const char[] static
2011-11-11 23:00:41 +09:00
Tatsuhiro Tsujikawa
d17ea2837b
HttpHeader::fill() now stores header name in lowercase.
...
Find methods in HttpHeader won't lowercase argument, so use lowercase
letters to get HTTP header field.
2011-11-11 22:50:18 +09:00
Tatsuhiro Tsujikawa
35a3f41346
Made Pref::k_, OptionHandler::getName() and getDescription() const char*.
2011-11-11 01:59:23 +09:00
Tatsuhiro Tsujikawa
787bfd75da
Use XmlParser for XML-RPC.
2011-11-11 00:37:32 +09:00
Tatsuhiro Tsujikawa
3b4a368554
Rewritten Expat Metalink XML parser.
2011-11-10 23:28:12 +09:00
Tatsuhiro Tsujikawa
440f29aca3
Rewritten Metalink XML parser.
...
Now we don't strip white spaces while parsing Metalink V3 document.
Expat implementation does not included in this change.
2011-11-10 22:38:01 +09:00
Tatsuhiro Tsujikawa
f114a6fba4
Now xml attribute and characters in RPC request is not stripped at all.
...
Changed XmlRpcRequestParserState so that name is now const char*.
2011-11-09 00:21:02 +09:00
Tatsuhiro Tsujikawa
bdaa87c73b
Avoid temporary string
2011-11-08 23:53:12 +09:00
Tatsuhiro Tsujikawa
7f8724c501
Removed temporary string
2011-11-08 23:45:40 +09:00
Tatsuhiro Tsujikawa
6ed36b73c1
Code cleanup
2011-11-08 23:27:23 +09:00
Tatsuhiro Tsujikawa
aa6f9c2057
Removed unused code
2011-11-08 23:13:47 +09:00
Tatsuhiro Tsujikawa
2ca98cc428
Use std::search instead of creating temporary std::string.
2011-11-08 00:59:49 +09:00
Tatsuhiro Tsujikawa
72a1847ba8
Rewritten *ARC4Encryptor. Removed *ARC4Context.
...
Now *ARC4Encryptor supports in-place encryption.
2011-11-08 00:50:07 +09:00
Tatsuhiro Tsujikawa
f6f053cae1
Fixed out of array bound
2011-11-08 00:15:37 +09:00
Tatsuhiro Tsujikawa
02b3873e6d
Removed ARC4Decryptor because ARC4Encryptor can decrypt the message.
2011-11-07 22:24:47 +09:00
Tatsuhiro Tsujikawa
30fdb08f40
Rewritten parametered URI handling routine.
2011-11-06 16:37:02 +09:00
Tatsuhiro Tsujikawa
d45d854926
Rewritten base64::decode and base64::encode
2011-11-05 23:30:46 +09:00
Tatsuhiro Tsujikawa
17a1b51a76
mv Base64.{cc,h} base64.{cc,h}
2011-11-05 21:13:49 +09:00
Tatsuhiro Tsujikawa
0c162dfbfb
Made util::fromHex and base32::decode function template
2011-11-05 18:05:23 +09:00
Tatsuhiro Tsujikawa
6ea1b68db1
Added SocketBuffer::pushStrSwap
2011-11-05 17:28:48 +09:00
Tatsuhiro Tsujikawa
4dad3ded15
Use SocketBuffer::pushBytes instead of pushStr in MSEHandshake.
2011-11-05 17:03:38 +09:00
Tatsuhiro Tsujikawa
5e2a8b2d4c
Fixed bug that some information such as port number is lost if
...
redirect URI contains only path component.
2011-11-05 13:16:45 +09:00
Tatsuhiro Tsujikawa
0b515d7204
Use uri::UriStruct in Request.h
2011-11-05 13:00:40 +09:00
Tatsuhiro Tsujikawa
7d68c40a77
Made decoderawstring return pair of iterators, not string.
2011-11-05 12:15:34 +09:00
Tatsuhiro Tsujikawa
d1d4903665
Rewritten bencode2::decode functions
2011-11-05 12:01:57 +09:00
Tatsuhiro Tsujikawa
d305432ec0
Code cleanup. Avoid std::string temporaries.
2011-11-05 01:26:09 +09:00
Tatsuhiro Tsujikawa
1d56c17225
Code cleanup. Avoid std::string temporaries.
2011-11-05 01:11:04 +09:00
Tatsuhiro Tsujikawa
150c1ab0c3
Code cleanup
2011-11-05 00:45:09 +09:00
Tatsuhiro Tsujikawa
5c88f61269
Added util::istartsWith()
2011-11-05 00:33:35 +09:00
Tatsuhiro Tsujikawa
79876af88f
Removed util::endsWith(a, b). Added util::iendsWith()
2011-11-05 00:25:24 +09:00
Tatsuhiro Tsujikawa
601ec0f44a
Removed util::startsWith(a, b)
2011-11-04 23:43:32 +09:00
Tatsuhiro Tsujikawa
f84d2253b2
Rewritten util::split and added its iterator version.
...
Iterator based functions util::startsWith, util::endsWith,
util::streq, util::strieq were added.
2011-11-04 22:27:58 +09:00
Tatsuhiro Tsujikawa
6267676e8b
util::divide now takes iterators as arguments.
2011-11-03 23:09:03 +09:00
Tatsuhiro Tsujikawa
118626afc4
util::percentDecode now takes iterators as arguments.
2011-11-03 19:27:29 +09:00
Tatsuhiro Tsujikawa
0e55fdf594
Code cleanup
2011-11-03 18:59:56 +09:00
Tatsuhiro Tsujikawa
84bc2c7ae8
Use std::string::append instead of appending std::string() temporaries.
2011-11-03 18:56:47 +09:00
Tatsuhiro Tsujikawa
9bb914b76e
Changed parse*Int functions so that it accepts iterators.
2011-11-03 18:51:31 +09:00
Tatsuhiro Tsujikawa
6ef91d60b3
Rewritten util::stripIter(), which now returns pair of iterator.
2011-11-03 16:19:21 +09:00
Tatsuhiro Tsujikawa
e8d4deecad
Rewritten HttpHeader::fill()
2011-11-03 00:31:27 +09:00
Tatsuhiro Tsujikawa
d9833743d9
Use merged option values.
2011-11-02 00:32:58 +09:00
Tatsuhiro Tsujikawa
1a418b518c
--index-out option is now available in aria2.changeOption.
...
--index-out option is now available in aria2.changeOption if a
download is waiting/paused in queue.
2011-11-02 00:27:31 +09:00
Tatsuhiro Tsujikawa
f884ad8339
Rewritten parseIndexPath. Renamed createIndexPathMap as createIndexPaths.
2011-11-02 00:18:39 +09:00
Tatsuhiro Tsujikawa
701a2d6ff8
--dir and --out option is now available in aria2.changeOption.
...
--dir and --out option is now available in aria2.changeOption if a
download is waiting/paused in queue.
2011-11-02 00:01:25 +09:00
Tatsuhiro Tsujikawa
9a51cc356b
Changed interface of BtRegistry.
...
BtRegistry now uses SharedHandle<BtObject> instead of BtObject.
2011-11-01 23:13:13 +09:00
Tatsuhiro Tsujikawa
a88a8b4ed1
Removed default value from deprecated --metalink-servers option.
2011-10-31 23:06:51 +09:00
Tatsuhiro Tsujikawa
22a3e44d36
SegList: Don't allow copying
2011-10-31 23:04:37 +09:00
Tatsuhiro Tsujikawa
57b37db8a1
--max-connection-per-server option is now available in aria2.changeOption.
...
--max-connection-per-server option is now available in
aria2.changeOption if a download is waiting/paused in queue.
2011-10-31 22:43:05 +09:00
Tatsuhiro Tsujikawa
9e2624a265
Apply PREF_MAX_CONNECTION_PER_SERVER to BitTorrent WEB Seeding hosts.
2011-10-31 22:05:56 +09:00
Tatsuhiro Tsujikawa
e2e711fba8
Reuse in-flight and pooled URIs when a download is paused.
2011-10-31 21:53:24 +09:00
Tatsuhiro Tsujikawa
4532881eb6
Code cleanup
2011-10-30 22:39:29 +09:00
Tatsuhiro Tsujikawa
84b19f154a
Deprecated --metalink-server option. Use --split option instead.
2011-10-30 21:36:36 +09:00
Tatsuhiro Tsujikawa
fc7af71aa8
--split option is now available in aria2.changeOption.
...
--split option is now available in aria2.changeOption if a download is
waiting/paused in queue.
2011-10-30 19:23:27 +09:00
Tatsuhiro Tsujikawa
1d9e673a68
--select-file option is now available in aria2.changeOption
...
--select-file option is now available in aria2.changeOption if a
download is waiting/paused in queue.
2011-10-30 19:13:40 +09:00
Tatsuhiro Tsujikawa
4552bb8c21
Code cleanup
2011-10-30 15:11:22 +09:00
Tatsuhiro Tsujikawa
4a455b5afe
Removed IntSequence and Sequence<T>
2011-10-30 15:08:44 +09:00
Tatsuhiro Tsujikawa
95586f594f
Use SegList<int> instead of IntSequence in Metalink2RequestGroup.
2011-10-30 15:04:15 +09:00
Tatsuhiro Tsujikawa
a6ea8531e7
Code cleanup
2011-10-30 14:42:19 +09:00
Tatsuhiro Tsujikawa
4be395117d
Use SegList<int> instead of IntSequence.
2011-10-30 14:25:36 +09:00
Tatsuhiro Tsujikawa
e9b86f2f43
Use SegList<int> instead of IntSequence in PeerListenCommand::bindPort()
2011-10-30 13:07:48 +09:00
Tatsuhiro Tsujikawa
d1667ea246
sgl.normalize() must be called before DownloadContext::setFileFilter() call.
...
sgl.normalize() was removed from DownloadContext::setFileFilter().
2011-10-30 00:51:06 +09:00
Tatsuhiro Tsujikawa
9b62a6e1fe
Made max value of --select-file to 65535
2011-10-30 00:45:10 +09:00
Tatsuhiro Tsujikawa
e23e9a4a65
Code cleanup
2011-10-30 00:13:08 +09:00
Tatsuhiro Tsujikawa
5749647ae5
Use SegList<int> instead of IntSequence in DownloadContext::setFileFilter()
2011-10-29 23:33:48 +09:00
Tatsuhiro Tsujikawa
78c3bcd199
Added SegList<T>, replacement of Sequence<T>
2011-10-29 21:51:58 +09:00
Tatsuhiro Tsujikawa
695c65eb86
--lowest-speed-limit option is now available in aria2.changeOption.
...
--lowest-speed-limit option is now available in aria2.changeOption if
a download is waiting/paused in queue.
2011-10-29 19:11:22 +09:00
Tatsuhiro Tsujikawa
95c7cb9f3e
--checksum option is now available in aria2.changeOption.
...
--checksum option is now available in aria2.changeOption if download
is waiting/paused in queue.
2011-10-29 19:08:04 +09:00
Tatsuhiro Tsujikawa
7cba24e8b2
Options for -i list is now available in aria2.changeOption.
...
Options for -i list, except for PREF_CHECKSUM, PREF_DIR, PREF_DRY_RUN,
PREF_INDEX_OUT, PREF_LOWEST_SPEED_LIMIT,
PREF_MAX_CONNECTION_PER_SERVER, PREF_METALINK_BASE_URI, PREF_OUT,
PREF_PIECE_LENGTH, PREF_SELECT_FILE, PREF_SPLIT, PREF_PAUSE and
PREF_PARAMETERIZED_URI, are available in aria2.changeOption if the
download is waiting state, including paused downloads.
2011-10-29 18:50:52 +09:00
Tatsuhiro Tsujikawa
0ba6f8c352
Use same domain-match algorithm for no-proxy and netrc.
...
Now "example.org" does not domain-match ".example.org" in both
functions.
2011-10-29 00:16:46 +09:00
Tatsuhiro Tsujikawa
5b0a2cb96b
Updated doc
2011-10-27 21:38:48 +09:00
Tatsuhiro Tsujikawa
33ba91fbc6
Fixed compile error without message digest support.
2011-10-25 21:59:10 +09:00
Tatsuhiro Tsujikawa
dfd214b3db
Disallowed checksum, index-out, out, pause and select-file option in
...
aria2.changeGlobalOption.
2011-10-25 21:56:16 +09:00
Tatsuhiro Tsujikawa
12659c74a8
Don't copy Option in RequestGroup ctor.
...
Copy on receive is not a practice in aria2 source code.
2011-10-25 21:44:04 +09:00
Tatsuhiro Tsujikawa
249fd90c92
Made -i list options available in aria2.changeGlobalOption.
2011-10-22 23:22:34 +09:00
Tatsuhiro Tsujikawa
2ef6b34e60
Made --download-result, --save-session, --server-stat-of and
...
--save-cookies option available in aria2.changeGlobalOption.
2011-10-22 23:08:40 +09:00
Tatsuhiro Tsujikawa
23a83deb4f
Renamed NameMatchOptionHandler as AbstractOptionHandler.
2011-10-22 22:57:44 +09:00
Tatsuhiro Tsujikawa
3d767543e6
Removed OptionHandler::{get,set}OptionID() and canHandle().
...
Removed typedefs in OptionHandler and NameMatchOptionHandler.
2011-10-22 22:52:23 +09:00
Tatsuhiro Tsujikawa
1872aef953
Made --max-download-result option available in aria2.changeGlobalOption.
2011-10-22 22:43:07 +09:00
Tatsuhiro Tsujikawa
c8ed44b18f
Made --uri-selector option available in -i list.
2011-10-22 21:49:46 +09:00
Tatsuhiro Tsujikawa
6bc6825cec
Renamed OptionHandler::setGlobalChangeOption() as setChangeGlobalOption().
2011-10-22 21:23:42 +09:00
Tatsuhiro Tsujikawa
5a29813d24
OptionHandler now knows its option can be used in -i list option,
...
changeable in aria2.changeOption or aria2.changeGlobalOption.
OptionHandler also now its option is cumulative.
2011-10-22 19:08:20 +09:00
Tatsuhiro Tsujikawa
d5c8d048ef
Rewritten OptionParser. Made it simpler and efficient.
2011-10-22 01:03:14 +09:00
Tatsuhiro Tsujikawa
3832ed97c6
Rewritten Option. Introduced Pref.
...
Now preference key is Pref instead of just string. It has Option
ID. Now option lookup and setting takes O(1) using Pref object.
2011-10-21 21:56:42 +09:00
Tatsuhiro Tsujikawa
20e781c2df
Code cleanup
2011-10-20 00:11:41 +09:00
Tatsuhiro Tsujikawa
9b4855a5f0
Use sockaddr_union instead of sockaddr_storage.
2011-10-20 00:06:44 +09:00
Tatsuhiro Tsujikawa
c01c34f24a
Use sockaddr_union in parseAsyncDNSServers().
2011-10-19 23:29:23 +09:00
Tatsuhiro Tsujikawa
138130497f
Rewritten bittorrent::packcompact() using net::getBinAddr().
2011-10-19 23:24:28 +09:00
Tatsuhiro Tsujikawa
3837be82c8
Removed redundant call of util::isNumericHost().
2011-10-19 23:21:10 +09:00
Tatsuhiro Tsujikawa
74e5aa0ace
Rewritten util::inSameCidrBlock() to support IPv6 address.
...
We also introduced union sockaddr_union in a2netcompat.h.
2011-10-19 23:14:13 +09:00
Tatsuhiro Tsujikawa
2b68f72fa6
Fixed bug that generateRandomData() does not populate data at the
...
first call.
2011-10-19 00:43:52 +09:00
Tatsuhiro Tsujikawa
4f0a45abe2
Made toXml and toJson non-member function.
2011-10-18 00:55:58 +09:00
Tatsuhiro Tsujikawa
e700d2bb1f
Made LpdMessage struct
2011-10-18 00:47:14 +09:00
Tatsuhiro Tsujikawa
fc4d38d236
Rewritten HttpProxyOptionHandler using uri::parse().
...
Removed test case where username is empty and resulted URI has empty
username in URI.
2011-10-18 00:40:43 +09:00
Tatsuhiro Tsujikawa
065fb3a6b8
HttpProxyOptionHandler: Enclose hostname with square brackets if
...
hostname is IPv6 numeric address.
2011-10-15 23:10:00 +09:00
Tatsuhiro Tsujikawa
2d6e087f58
Use /dev/urandom in generateRandomData() if available.
2011-10-13 23:12:05 +09:00
Tatsuhiro Tsujikawa
dbb08c08ed
Simplified IteratableChecksumValidator
2011-10-13 22:07:22 +09:00
Tatsuhiro Tsujikawa
ba87268d1c
Simplified IteratableChunkChecksumValidator
2011-10-13 22:05:18 +09:00
Tatsuhiro Tsujikawa
2f59ce0048
Renamed DownloadResult::bitfieldStr to bitfield and changed its
...
content from hex string to raw byte string.
2011-10-13 21:57:33 +09:00
Tatsuhiro Tsujikawa
6404f119e1
Renamed DownloadResult::infoHashStr to infoHash and changed its
...
contents from hex digest to raw byte string.
2011-10-13 21:52:08 +09:00
Tatsuhiro Tsujikawa
310e58bc62
Stored hash value as raw byte string, instead of hex digest.
2011-10-13 21:40:07 +09:00
Tatsuhiro Tsujikawa
d83f42ef36
s/STD_INPUT_HANDLE/STD_OUTPUT_HANDLE/
2011-10-05 22:52:03 +09:00
Tatsuhiro Tsujikawa
8938cef9b3
Made several messages translatable
2011-10-02 16:14:03 +09:00
Tatsuhiro Tsujikawa
a077ddd111
Fixed compile error with --without-libxml2 --without-libexpat
2011-09-28 23:41:22 +09:00
Tatsuhiro Tsujikawa
5ce9af94ce
Check libgcrypt version is greater or equal to required version.
...
This will fixes Debian bug#642989.
2011-09-28 23:40:34 +09:00
Tatsuhiro Tsujikawa
7e7aeac3ff
Added --piece-length option.
...
This option sets a piece length for HTTP/FTP downloads. This is the
boundary when aria2 splits a file. All splits occur at multiple of
this length. This option will be ignored in BitTorrent downloads. It
will be also ignored if Metalink file contains piece hashes.
2011-09-27 21:48:41 +09:00
Tatsuhiro Tsujikawa
05104ba177
Removed asString, asList, ... and use downcast<T> instead.
2011-09-26 21:45:45 +09:00
Tatsuhiro Tsujikawa
374955da0d
Throw exception if parameter has wrong type in RPC method.
...
Formally, depending on the method implementation, this kind of error
is just ignored and parameter is skipped. Now aria2 responds error for
these cases. The required parameter checking is also reworked along
with this change.
2011-09-25 23:36:00 +09:00
Tatsuhiro Tsujikawa
fee9b95db3
Don't check readability of BitTorrent TCP socket.
...
Don't check readability of BitTorrent TCP socket to avoid flooding.
2011-09-11 00:54:33 +09:00
Tatsuhiro Tsujikawa
79c59dcbf4
Cleanup log message for binding server socket.
...
Cleaned up log message for binding server socket. After binding
BitTorrent TCP port, add the socket to DownloadEngine to check
readability. This was missing for long time.
2011-09-11 00:13:09 +09:00
Tatsuhiro Tsujikawa
b775b19366
Check socket is null or not before calling (add|delete)SocketForReadCheck.
2011-09-11 00:12:18 +09:00
Tatsuhiro Tsujikawa
c408dbba72
Recognize tab as white space before option in -i list.
2011-08-28 00:40:23 +09:00
Tatsuhiro Tsujikawa
f25c89b53d
Added usage of --stream-piece-selector=geom option.
2011-08-25 00:04:04 +09:00
Tatsuhiro Tsujikawa
c7ac147287
Added PieceStorage::onDownloadIncomplete() virtual function.
...
In DefaultPieceStorage::onDownloadIncomplete(), we call
StreamPieceSelector::onBitfieldInit().
Added GeomStreamPieceSelectorTest.
2011-08-24 23:16:06 +09:00
Tatsuhiro Tsujikawa
b94bf3355b
getGeomMissingUnusedIndex: use index if isBitSet() is false.
...
In getGeomMissingUnusedIndex(), use index if isBitSet() is false
instead of finding isUseBitSet() == true and cancel. Added doc for
getGeomMissingUnusedIndex(). Renamed confusing names in bitfield.h.
2011-08-24 22:59:00 +09:00
Tatsuhiro Tsujikawa
a081f651a1
GeomStreamPieceSelector: Made base changeable and added offsetIndex
...
parameter.
2011-08-24 21:56:55 +09:00
Tatsuhiro Tsujikawa
7318c361bc
Added geom parameter to --stream-piece-selector option.
2011-08-24 21:56:54 +09:00
Tatsuhiro Tsujikawa
201af99501
Added GeomStreamPieceSelector.
2011-08-24 21:56:54 +09:00
Tatsuhiro Tsujikawa
846b9b9283
Detect \b as \f as valid UTF-8 chars.
2011-08-24 21:55:32 +09:00
Tatsuhiro Tsujikawa
09ce8960fd
Added completedLength response key in aria2.getFiles RPC method.
2011-08-23 18:47:27 +09:00
Tatsuhiro Tsujikawa
91220f20ca
Added #checksum help tag.
2011-08-23 17:59:38 +09:00
Tatsuhiro Tsujikawa
b7b5fac13c
Updated usage of -V option.
2011-08-23 17:55:22 +09:00
Tatsuhiro Tsujikawa
401a217369
Added --checksum option.
...
Added --checksum=TYPE=DIGEST option. This option sets checksum. TYPE
is hash type. The supported hash type is listed in "Hash Algorithms"
in "aria2c -v". DIGEST is hex digest. For example, setting sha-1
digest looks like this: sha-1=0192ba11326fe2298c8cb4de616f4d4140213838
This option applies only to HTTP(S)/FTP downloads.
2011-08-23 17:25:15 +09:00
Tatsuhiro Tsujikawa
8ec6cd1c44
Removed redundant MessageDigest::supports() call.
...
MessageDigest::supports() will be called from
MessageDigest::isValidHash() later in the function.
2011-08-23 17:23:46 +09:00
Tatsuhiro Tsujikawa
6c5c796646
Added --hash-check-only opiton.
...
Added --hash-check-only opiton. If true is given, after hash check
using --check-integrity option, abort download whether or not download
is complete. The default value is false.
2011-08-22 23:34:17 +09:00
Tatsuhiro Tsujikawa
f7aeb86ccc
Added --download-result option.
...
Added --download-result=OPT option. This option changes the way
"Download Results" is formatted. If OPT is 'default', print GID,
status, average download speed and path/URI. If multiple files are
involved, path/URI of first requested file is printed and remaining
ones are omitted. If OPT is 'full', print GID, status, average
download speed, percentage of progress and path/URI. The percentage of
progress and path/URI are printed for each requested file in each row.
2011-08-22 23:05:06 +09:00
Tatsuhiro Tsujikawa
3c73b6e767
Eliminated inet_ntoa and inet_ntop. Use getnameinfo() instead.
2011-08-20 21:53:48 +09:00
Tatsuhiro Tsujikawa
af46293ef9
Use utimes instead of utime if utimes is available.
2011-08-19 22:35:15 +09:00
Tatsuhiro Tsujikawa
3fe4e84443
Removed unused preferences.
2011-08-19 22:11:38 +09:00
Tatsuhiro Tsujikawa
384ef111b9
Added --rpc-allow-origin-all option.
...
This option adds Access-Control-Allow-Origin header field with value
'*' to the RPC response.
2011-08-18 21:24:18 +09:00
Tatsuhiro Tsujikawa
4c1c38a33f
Ignore --out option supplied in command-line if -i is used.
...
You can still use out option in the text file specified in -i.
2011-08-18 18:36:17 +09:00
Tatsuhiro Tsujikawa
bf42505b7b
MinGW32: Use CryptGenRandom() to generate random number.
...
MinGW32 lacks random(), so we use CryptGenRandom() as a replacement.
In the implementation, SimpleRandomizer::getRandomNumber() returns the
random number in range [0, INT32_MAX]. Thus,
simpleRandomizer::getMaxRandomNumber() returns INT32_MAX.
2011-08-18 18:03:06 +09:00
Tatsuhiro Tsujikawa
dce0667c0b
MinGW32 build: Replace all '\' in path with '/' in util::applyDir()
...
In MinGW32 build, replace all '\' in path with '/' in
util::applyDir(). Take into account '\' in File::getBasename() and
File::getDirname().
2011-08-18 17:27:41 +09:00
Cristian Rodríguez
e6f3c78103
- Disable SSLv2 and enable all workarounds for buggy servers
...
- Keep memory usage low when openSSL supports SSL_MODE_RELEASE_BUFFERS
2011-08-15 17:55:58 -03:00
Tatsuhiro Tsujikawa
fd3e7671a5
Use random() instead of rand().
2011-08-11 02:34:04 +09:00
Tatsuhiro Tsujikawa
e76dc28f7f
Added libnettle and libgmp support.
...
libnettle and libgmp is used by default. Old implementation uses
libgcrypt as default. If more and more Linux distributions offer
libnettle linked GnuTLS, then this change decrease library dependency
against libgcrypt and libgpg-error. The current library detection for
libnettle and libgmp is very simple, just use AC_SEARCH_LIBS.
util::generateRandomData() was written using SimpleRandomizer, thus no
external library dependency from this function.
2011-08-11 02:29:14 +09:00
Tatsuhiro Tsujikawa
11ac2c4a88
Added DHKeyExchange implementation using GMP.
2011-08-11 00:08:29 +09:00
Tatsuhiro Tsujikawa
6edfa4e430
Limit maximum length of ByteArrayWriter.
...
aria2 downloads meta files such as .torrent and .metalink file in
memory using ByteArrayWriter. To prevent accidentally download big
file, we set the maximum length that ByteArrayWriter can hold. The
default is 5MiB and it is reasonable because most .torrent and
.metalink file are much smaller than that.
2011-08-10 23:58:49 +09:00
Tatsuhiro Tsujikawa
2d9323651b
Don't use sorted std::deque for requestSlots_.
...
Don't use sorted deque for requestSlots_. For the most time, first
data requested is sent back first. So using std::deque, we find
received RequestSlot by O(1), while sorted std::deque requires
O(logN).
2011-08-10 23:18:23 +09:00
Tatsuhiro Tsujikawa
6ee913b0bc
Simplified PieceStatMan and RarestPieceSelector.
...
Simplified PieceStatMan and RarestPieceSelector, but computation order
to select piece index is still O(N) and unchanged. Updating piece
stat is improved to O(N) for bitfield update and O(1) for single
index update, while old implementation needs O(NlogN) and O(N)
respectively.
2011-08-10 21:29:01 +09:00
Tatsuhiro Tsujikawa
37016c6587
global cout and cerr is now retrieved using global::cout() and global::cerr()
...
This is necessary to avoid global variable initialization order
problem.
2011-08-10 01:28:20 +09:00
Tatsuhiro Tsujikawa
e8e3a6f259
wallclock is now retrieved using global::wallclock() call.
...
This is necessary to avoid global variable initialization order
problem.
2011-08-10 01:17:28 +09:00