Tatsuhiro Tsujikawa
118aed9c24
Content-Disposition parser conforming to RFC 6266.
...
RFC 2231 Continuation is not supported.
2012-10-27 14:51:07 +09:00
Tatsuhiro Tsujikawa
0ecfa19925
Reworked download/upload statistics calculation
...
The old implementation calculates download/upload statistics for a
RequestGroup by summing up all PeerStat objects. For global
statistics, those are summed together. This clearly incurs runtime
penalty and we introduced some kind of caching which updates
statistics every 250ms but it did not work right.
This change removes all these aggregation code, and instead makes
RequestGroup and RequestGroupMan objects hold NetStat object and
download/upload bytes are directly calculated by thier own NetStat.
This is far more simplar than the old way and less runtime penalty and
brings more accuracy.
2012-10-25 23:33:45 +09:00
Tatsuhiro Tsujikawa
46bdaf0e8d
Made HTTP/FTP download speed limiter more accurate
...
We have to do the same thing for BitTorrent.
2012-10-24 01:05:41 +09:00
Tatsuhiro Tsujikawa
a9c76ed35e
Added --rpc-save-upload-metadata option
...
If true is given, which is default, save the uploaded torrent or
metalink metadata in the directory specified by --dir option. The
filename consists of SHA1-hash hex string of metadata plus
extension. For torrent, the extension is '.torrent'. For metalink, it
is '.meta4'. If false is given to this option, the downloads added by
aria2.addTorrent or aria2.addMetalink will not be saved by
--save-session option.
2012-10-16 00:18:34 +09:00
Tatsuhiro Tsujikawa
692f978978
Rewritten URI parser
2012-10-14 00:14:50 +09:00
Tatsuhiro Tsujikawa
8b0c701266
Removed trailing spaces
2012-10-01 23:52:22 +09:00
Tatsuhiro Tsujikawa
e34d0e7ffa
Dont' return SharedHandle from HttpHeader::getRange()
2012-09-30 17:30:35 +09:00
Tatsuhiro Tsujikawa
4b94ede268
Return ExtensionMessage subclass create return raw pointer
2012-09-28 23:40:44 +09:00
Tatsuhiro Tsujikawa
3258614033
Removed *Handle typedef
2012-09-28 23:27:46 +09:00
Tatsuhiro Tsujikawa
215d1d3d0b
Made static create function of BtMessage subclass return raw pointer
2012-09-27 23:40:25 +09:00
Tatsuhiro Tsujikawa
ae2e4cb7ff
Handle OptionHandlers as raw pointer
2012-09-27 22:45:31 +09:00
Tatsuhiro Tsujikawa
8fc5cdea02
Removed unused functions
2012-09-27 01:03:39 +09:00
Tatsuhiro Tsujikawa
89f18dde85
Use nothrow version of parseInt, parseUInt and parseLLInt
2012-09-27 00:45:32 +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
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
f133091a9e
Made BufferedFile ctor take const char* args
2012-09-25 23:44:41 +09:00
Tatsuhiro Tsujikawa
260a0b8bcb
Rewritten AnnounceList::getEventString()
2012-09-25 00:07:14 +09:00
Tatsuhiro Tsujikawa
a8c0794640
Made DEFAULT_STRIP_CHARSET const char[]
2012-09-24 23:54:41 +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
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
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
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
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
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
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
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
995c07c184
Fixed base64::decode() return "" if input ends with garbase and no padding
2012-07-04 22:51:41 +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
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
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
5fc1b1ad29
Rewritten HTTP header parser
2012-06-23 17:34:20 +09:00
Tatsuhiro Tsujikawa
9ba65aea1d
Rewritten ChunkedDecodingStreamFilter
2012-06-18 23:42:46 +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
7785ea8c4b
Code cleanup
2012-05-16 23:28:19 +09:00
Tatsuhiro Tsujikawa
0e5ae22f73
Fixed memory leak
2012-05-16 23:28:07 +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
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
1e0068e4d4
WebSocket: Check keyword string in comma separeted values in HTTP
...
header field.
2012-04-08 19:00:07 +09:00
Tatsuhiro Tsujikawa
d9bb24a2e0
Fixed gcc-4.7 warnings
2012-04-08 03:12:29 +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
0a9abd89c6
Rewritten TLS hostname check based on RFC 6125.
2012-03-30 23:49:14 +09:00
Tatsuhiro Tsujikawa
25ef6677e9
Added hostname check described in RFC 2818 with OpenSSL.
2012-03-28 23:28:22 +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
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
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
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
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
a6803c21b5
Support network-path reference in HTTP redirect.
2012-01-11 02:17:38 +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
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
3637291c22
Fixed compile warning/error with mingw32
2011-12-10 19:06:09 +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
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
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
dd8824ab11
Don't compare c-strng using CPPUNIT_ASSERT_EQUAL
2011-12-02 00:30:11 +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
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
db5cc4db27
Don't append character to std::string.
2011-11-12 21:27:24 +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
2f4393d17c
Rewritten parse*Int
2011-11-12 01:06:52 +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
aa6f9c2057
Removed unused code
2011-11-08 23:13:47 +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
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
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
d1d4903665
Rewritten bencode2::decode functions
2011-11-05 12:01:57 +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