Commit Graph

1140 Commits (db5af2cec3d058fcb33ffee7a3d9d3641a03fddd)

Author SHA1 Message Date
Tatsuhiro Tsujikawa 4803482a51 HttpRequest: Store non-owning raw pointer for authConfigFactory_ 2013-06-25 22:06:29 +09:00
Tatsuhiro Tsujikawa 2761301dfb Rewrite util::divide 2013-06-25 00:07:15 +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 23086b6e21 AbstractBtMessage: Use std::unique_ptr for validator 2013-06-23 16:12:19 +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 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 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 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
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 232d31afaf Add test for recent changes in SessionSerializer 2013-05-28 22:59:54 +09: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 7669c72d03 Add unittest for DownloadResultDH 2013-05-27 22:04:44 +09:00
Tatsuhiro Tsujikawa b0799b6e46 Introduce IOFile abstract class to refactor BufferedFile and GZipFile
IOFile provides the same interface of old BufferedFile. It provides
extension points as pure virtual functions. Those functions are
implemented by 2 concrete subclasses: BufferedFile and GZipFile.
2013-05-23 23:12:32 +09:00
Tatsuhiro Tsujikawa db1106101d Fix compile error without bittorrent support 2013-05-23 00:46:08 +09:00
Tatsuhiro Tsujikawa 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 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 be4c9aa95e Test failure without Metalink and BitTorrent support 2013-05-15 23:31:49 +09:00
Tatsuhiro Tsujikawa 8e8fb9ee36 Add addTorrent API 2013-05-15 23:29:28 +09:00
Tatsuhiro Tsujikawa 4e8742597a Add aria2api unit tests 2013-05-15 22:59:26 +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 d07b3ff8d9 Suppress console output for none-standalone mode 2013-05-02 11:30:42 +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 9041be8e32 Add tailmatch testcase for cookie 2013-04-15 21:30:15 +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 80dbaf2566 Use util::sleep() instead of sleep() 2013-03-31 18:02:46 +09:00
Tatsuhiro Tsujikawa 15b19f7baf Add timeout when receiving Multicast packet in LpdMessageDispatcherTest 2013-03-21 21:38:55 +09:00
Tatsuhiro Tsujikawa 5e4029a355 Fix unit test HttpRequestTest.cc 2013-03-18 22:47:12 +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 841fdbb965 Add GZipFileTest
For now, it is a copy of BufferedFileTest.cc
2013-03-03 14:16:32 +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 7f6a446750 Hygiene: Fix some clang warnings, mostly unused private members. 2013-03-01 13:17:52 +01:00
Tatsuhiro Tsujikawa a49397ed19 Fix infinite loop when size of downloadResults_ exceeds maxDownloadResult_ 2013-02-25 21:42:54 +09:00
Tatsuhiro Tsujikawa d68741697a Support UDP tracker
It shares UDP listening port with IPv4 DHT. At the moment, in order to
enable UDP tracker support, enable IPv4 DHT.
2013-02-25 00:56:49 +09:00
Tatsuhiro Tsujikawa 67fa274578 Add test when instance-length is 0 2013-02-21 00:42:37 +09:00
Tatsuhiro Tsujikawa 45a128a7e8 Add test for saving finished download with force-save option 2013-02-04 21:56:48 +09:00
Tatsuhiro Tsujikawa 3fc45edaa7 Fix bug that active downloads are not saved with --save-session-interval 2013-02-04 21:50:09 +09:00
Tatsuhiro Tsujikawa 1c9cfccac4 Fix invalid iterator handling when deleting RequestGroup 2013-02-03 18:18:28 +09:00
Tatsuhiro Tsujikawa 13975f66a2 test: Add missing filelist2.txt to EXTRA_DIST 2013-02-02 21:22:18 +09:00
Tatsuhiro Tsujikawa 561f0b3e29 Use std::deque instead of std::list in IndexedList
We choose faster iteration over rare slower deletion in the middle.
2013-02-01 00:03:47 +09:00
Tatsuhiro Tsujikawa 3a19b65dd7 Rename /BadCondition/ in Peer to /Drop/ 2013-01-26 18:50:48 +09:00
Tatsuhiro Tsujikawa 1e4f301ec1 Remove PeerStorage::getActivePeers() and add getUsedPeers() instead
PeerStorage::getUsedPeers() returns non-active peers, so caller must
call Peer::isActive() to get active peers.
2013-01-26 18:36:09 +09:00
Tatsuhiro Tsujikawa ba69f5c0c3 Refactor peer list management in DefaultPeerStorage
Peer list is now divided into 2: unusedPeers_ and usedPeers_.
Duplicate check is done using std::set by comparing pair of IP address
and port. For this, only IP address and port given to the Peer
constructor are used. In other words, TCP port received from extended
message is not used for this purpose.
2013-01-26 17:50:06 +09:00
Tatsuhiro Tsujikawa 88580da587 Remove Append and StringAppend 2013-01-15 21:46:03 +09:00
Tatsuhiro Tsujikawa 6a976a4118 Accept k and m as well as K and M in util::getRealSize() 2013-01-15 21:36:25 +09:00
Tatsuhiro Tsujikawa 2e216a9403 Fix unit test error 2013-01-14 21:34:33 +09:00
Tatsuhiro Tsujikawa c893d82867 Removed BtMessage::isSendingProgress()
DefaultBtMessageDispatcher::isSendingInProgress() now checks the
number of buffer entry in PeerConnection.
2013-01-11 20:26:31 +09:00
Tatsuhiro Tsujikawa 8ba0d58ee1 Vectorized write for SocketBuffer to avoid small packet 2013-01-11 16:50:04 +09:00
Tatsuhiro Tsujikawa 87af7c32c6 Use request URI as referer if --referer="*" is given 2013-01-08 21:42:42 +09:00
Tatsuhiro Tsujikawa 247084f9c3 Fixed bug that USR_BASENAME is not defined
In some cases, if the dirname is only "/", the basename will not be
defined (e.g., "/f"). This change fixes this bug.
2012-12-27 00:03:37 +09:00
Tatsuhiro Tsujikawa 616cd9e75f Simplified RequestGroupMan::fillRequestGroupFromReserver 2012-12-22 23:37:44 +09:00
Tatsuhiro Tsujikawa b017e80438 Changed threshold of using upper unit for abbrevSize 2012-12-19 23:58:24 +09:00
Tatsuhiro Tsujikawa 07bb779eb0 Faster deletion of RequestGroup and DownloadResult lists 2012-12-19 23:03:48 +09:00
Tatsuhiro Tsujikawa 77a4ee4de0 Save gid option with --save-session option 2012-12-17 00:33:11 +09:00
Tatsuhiro Tsujikawa 0a4ce4fdb5 Use map to make DownloadResult lookup fast 2012-12-16 18:50:45 +09:00
Tatsuhiro Tsujikawa b9da9d4ed3 Use 64 bits random bytes as GID
This change replaces the current 64 bit sequential GID with 64 bits
random bytes GID in an attempt to support persistent GID. Internally,
the GID is stored as uint64_t. For human representation and RPC
interface, GID is represented as 16 bytes hex string. For console
readout, 16 bytes are too long, so it is abbreviated to first 6 bytes.
When querying GID in RPC calls, user can speicfy the prefix of GID as
long as the prefix is shared by more than 1 GID entries.
2012-12-16 17:29:01 +09:00
Tatsuhiro Tsujikawa 04586f50b1 Fixed BitfieldMan::getOffsetCompletedLength overflow on 32-bit systems 2012-12-16 17:26:01 +09:00
Tatsuhiro Tsujikawa de1ca6d6b8 mingw32: Use HANDLE only for MinGW32 build 2012-12-15 18:28:46 +09:00
Tatsuhiro Tsujikawa 4fdd5da27d Compact readout when more than 1 simultaneous downloads are going on
If more than 1 simultaneous downloads are going on, use more compact
format in readout. Currently, at most 5 download stats are displayed.

util::abbrevSize() is rewritten to support "Gi" unit and provides more
compact abbreviation.
2012-12-11 23:40:06 +09:00
Tatsuhiro Tsujikawa df5f1fe77f Fixed bug that size_ is not updated when WrDiskCacheEntry::append is called 2012-12-06 03:04:05 +09:00
Tatsuhiro Tsujikawa 838949ab85 Append new data to the contagious cache data
If we receive small data (e.g., 1 or 2 bytes), cache entry becomes a
headache. To mitigate this problem, we allocate cache buffer at least
4KiB and append the data to the contagious cache data.
2012-12-06 02:23:32 +09:00
Tatsuhiro Tsujikawa 56c498bcbf Clear write cache on Segment::clear and Piece::clearAllBlock 2012-12-06 00:39:14 +09:00
Tatsuhiro Tsujikawa 9ed8502e74 Write data in 4K aligned offset in write with disk cache enabled
This greatly reduces disk activity especially on Win + NTFS.  Not so
much difference on Linux.
2012-12-06 00:17:11 +09:00
Tatsuhiro Tsujikawa 8f2a4cc716 Removed unused members 2012-12-03 21:32:09 +09:00
Tatsuhiro Tsujikawa f314719618 Added --disk-cache option
This option enables disk cache. If SIZE is 0, the disk cache is
disabled. This feature caches the downloaded data in memory, which
grows to at most SIZE bytes. The cache storage is created for aria2
instance and shared by all downloads. The one advantage of the disk
cache is reduce the disk seek time because the data is written in
larger unit and it is reordered by the offset of the file. If the
underlying file is heavily fragmented it is not the case.
2012-12-03 01:39:10 +09:00
Tatsuhiro Tsujikawa e781e6eac1 Made socket non-blocking mode in SocketCore::beginListen() 2012-11-28 00:15:03 +09:00
Tatsuhiro Tsujikawa 438f95abae Made socket non-blocking mode in SocketCore::acceptConnection() 2012-11-28 00:10:32 +09:00
Tatsuhiro Tsujikawa 31189b1222 Made return type of util::parse_content_disposition ssize_t 2012-11-01 22:54:32 +09:00
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