Commit Graph

973 Commits (d13aa3a0b3b32c619e17c4c30d767267c3648359)

Author SHA1 Message Date
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
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 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 f884ad8339 Rewritten parseIndexPath. Renamed createIndexPathMap as createIndexPaths. 2011-11-02 00:18:39 +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 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 84b19f154a Deprecated --metalink-server option. Use --split option instead. 2011-10-30 21:36:36 +09:00
Tatsuhiro Tsujikawa 4a455b5afe Removed IntSequence and Sequence<T> 2011-10-30 15:08:44 +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 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 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 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 62a07fff5f Fixed unit test 2011-10-25 00:05:28 +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 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 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 4747d003f7 Added test for inetNtop() 2011-10-18 22:57:59 +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 310e58bc62 Stored hash value as raw byte string, instead of hex digest. 2011-10-13 21:40:07 +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 c408dbba72 Recognize tab as white space before option in -i list. 2011-08-28 00:40:23 +09:00
Tatsuhiro Tsujikawa a743bef220 Fixed output file path of tests. 2011-08-25 00:26:36 +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 a081f651a1 GeomStreamPieceSelector: Made base changeable and added offsetIndex
parameter.
2011-08-24 21:56:55 +09:00
Tatsuhiro Tsujikawa 201af99501 Added GeomStreamPieceSelector. 2011-08-24 21:56:54 +09:00
Tatsuhiro Tsujikawa 0f72cbab8a JsonTest: Added test case for decoding escaped chars 2011-08-24 21:55:54 +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 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 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
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 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
Tatsuhiro Tsujikawa 97f34ab668 Added global::cerr. windows.h now included from common.h
We replaced most of std::cerr with global::cerr.  windows.h is now
included from common.h. Before including it, we define WINVER.  We
renamed some variable name because some macros in windows.h collide
with them.
2011-08-10 00:38:48 +09:00
Tatsuhiro Tsujikawa a10cda2f17 Use global::cout to output string to stdout.
In MinGW32 build, global::cout is WinConsoleFile. When outputing to
console, it uses WriteConsoleW, so Unicode characters are written.
Fixed memory leak in WChar<->MultiByte conversion functions.  The
portion of code which uses std::cout is rewritten to use global::cout.
2011-08-09 23:33:55 +09:00
Tatsuhiro Tsujikawa 7368c9c9d8 Percent-encode non-printable ASCII and non-ASCII chars in FileEntry.
Percent-encode non-printable ASCII and non-ASCII chars in URI using
util::percentEncodeMini() when URI is added to FileEntry.  Removed
percent-encode from Request. Also do percent-encoding when setting
referer and redirected URI.
2011-08-07 20:46:04 +09:00
Tatsuhiro Tsujikawa a6c2ad53bf Rewritten UriListParser using BufferedFile 2011-08-07 01:05:02 +09:00
Tatsuhiro Tsujikawa 1f710d29c1 Rewritten SessionSerializer using BufferedFile 2011-08-07 00:36:44 +09:00
Tatsuhiro Tsujikawa 190d170076 Rewritten ServerStatMan using BufferedFile. 2011-08-07 00:10:53 +09:00
Tatsuhiro Tsujikawa 7f3d027b83 Removed feof from operator unspecified_bool_type. Added eof().
In BufferedFile, removed feof from operator unspecified_bool_type. EOF
can be queried separately using newly added eof().
2011-08-07 00:06:32 +09:00
Tatsuhiro Tsujikawa 6cb91cae88 Added fopen/fread/fwrite/fgets wrapper class. 2011-08-06 21:17:36 +09:00
Tatsuhiro Tsujikawa 168094560d Rewritten CookieStorage using stdio instead of stream 2011-08-05 22:44:54 +09:00
Tatsuhiro Tsujikawa dea7a7969c Rewritten DHTRoutingTableSerializer using stdio instead of stream. 2011-08-05 22:15:55 +09:00
Tatsuhiro Tsujikawa f141cd4228 Rewritten DHTRoutingTableDeserializer using stdio instead of stream. 2011-08-05 21:50:11 +09:00
Tatsuhiro Tsujikawa 3879da592d In MinGW32, open file with UNICODE filename and print them in ANSI. 2011-08-04 21:43:02 +09:00
Tatsuhiro Tsujikawa 70eeebfae9 Retry DHT get_peers task if the number of peers in PeerStorage is less
than max peers.

Added virtual size_t countPeer() const to PeerStorage.
2011-07-29 23:49:25 +09:00
Tatsuhiro Tsujikawa 4ea28cb837 Don't send basic auth header to service operated on differenct port.
When --http-auth-challenge=true, aria2 only sends basic auth header
when requested. Old implementation sends basic auth header to service
operated in different port in successive request. This change avoid
this bug.
2011-07-27 23:28:31 +09:00
Tatsuhiro Tsujikawa 02292feaba Consistent naming scheme for hash type and digest for Piece. 2011-07-27 22:50:10 +09:00
Tatsuhiro Tsujikawa 03f0774482 Consistent naming scheme for hash type and digest for DownloadContext. 2011-07-27 22:44:30 +09:00
Tatsuhiro Tsujikawa 7b86b294c9 Consistent naming scheme for hash type and digest. 2011-07-27 21:44:54 +09:00
Tatsuhiro Tsujikawa 67e91c3431 HttpResponse::getDigest() now returns all Digest.
In addition, HttpResponse::getMetalinkHttpEntries() does not check
validity of URI. It is checked when we add it to FileEntry.
2011-07-27 19:32:35 +09:00
Tatsuhiro Tsujikawa 7c317de4e7 Added Metalink/HTTP Link and Digest header field parser. 2011-07-26 23:41:21 +09:00
Tatsuhiro Tsujikawa c58f736bb9 BtRegistry now holds BitTorrent TCP server port.
Because BitTorrent TCP server port is global configuration, it is not
preferable that per download resource BtRuntime holds it.  We also
refactored and eliminated ugly static variable in PeerListenCommand.
If TCP port is necessary, we inject it to them directly.
2011-07-21 23:42:41 +09:00
Tatsuhiro Tsujikawa dbf4f553ca Deprecated --enable-direct-io option.
Modified DeprecatedOptionHandler so that it can have replacing
OptionHandler.
2011-07-16 16:03:28 +09:00
Tatsuhiro Tsujikawa 5c4a52ad74 Managed user cuid in Piece.
Previous implementation does not store information which Command cuid
uses which Piece.  Mark Piece acquired by SegmentMan by setting
Piece::setUsedBySegment(true).
2011-07-16 00:58:41 +09:00
Tatsuhiro Tsujikawa d1885a5874 Allowed missing params in system.multicall RPC method. 2011-06-15 00:42:50 +09:00
Tatsuhiro Tsujikawa 65ec9e98df Replaced InOrder with Inorder. 2011-06-11 21:49:09 +09:00
Tatsuhiro Tsujikawa deaea9537b Added --stream-piece-selector option.
This option specifies piece selection algorithm used in HTTP/FTP
download. Piece means fixed length segment which is downloaded in
parallel in segmented download. If 'default' is given, aria2 selects
piece so that it reduces the number of establishing connection. This
is reasonable default behaviour because establishing connection is an
expensive operation.  If 'inorder' is given, aria2 selects piece which
has minimum index. Index=0 means first of the file. This will be
useful to view movie while downloading it. --enable-http-pipelining
option may be useful to reduce reconnection overhead.  Please note
that aria2 honors --min-split-size option, so it will be necessary to
specify a reasonable value to --min-split-size option.
2011-06-11 21:41:56 +09:00
Tatsuhiro Tsujikawa 595a514b17 Fixed typo 2011-06-11 18:03:33 +09:00
Tatsuhiro Tsujikawa cc82da3bab Added StreamPieceSelector class.
This class abstracts the piece selection algorithm for HTTP/FTP
download.
2011-06-11 17:34:17 +09:00
Tatsuhiro Tsujikawa 2799c9f0cc Only percent-encode non-printable ASCII chars(0x00-0x1f), non-ASCII
chars(>0x7f), ' ', '"', '<' and '>' for URIs supplied by user and
remote server(usually Location header field).
2011-06-01 01:34:30 +09:00
Tatsuhiro Tsujikawa 4784114281 Don't save removed download in --save-session text file.
Now stat column of removed downloads in Download Results is 'RM'
instead of INPR.
2011-05-29 20:59:45 +09:00
Tatsuhiro Tsujikawa 0f9b59cdce Fixed compile error with g++-4.6.1 2011-05-21 00:04:25 +09:00
Tatsuhiro Tsujikawa 5cef1cb15c Added missing base_uri.xml to EXTRA_DIST 2011-05-16 23:28:33 +09:00
Tatsuhiro Tsujikawa 286991e17d Strip DQUOTE from cookie-value and updated doc. 2011-05-14 21:24:10 +09:00
Tatsuhiro Tsujikawa ad5af56c17 Support relative URI in Metalink file.
If relative URI is found in Metalink file, aria2 resolves its full URI
contatenating the URI from which Metalink file is retrieved and
relative URI in Metalink file. This feature is not available if
Metalink file in local disk is specified in command line.
2011-05-07 18:41:18 +09:00
Tatsuhiro Tsujikawa e7d7233d54 Moved joinUri from util namespace to uri namespace. 2011-05-06 23:20:43 +09:00
Tatsuhiro Tsujikawa 1122e55a35 Handle "..", "." in util::joinUri() 2011-04-30 22:42:10 +09:00
Tatsuhiro Tsujikawa 55d00d047c Added swap for UriStruct 2011-04-30 00:29:14 +09:00
Tatsuhiro Tsujikawa 871819af59 Added util::joinUri() 2011-04-30 00:15:27 +09:00
Tatsuhiro Tsujikawa 33b9b3b27d Added uri::construct() 2011-04-30 00:14:49 +09:00
Tatsuhiro Tsujikawa 3941c72219 Added test for OptionParser::getEraseAfterParse() 2011-04-22 23:45:30 +09:00
Tatsuhiro Tsujikawa 211c4ea9f4 If no data type tag is used in XML-RPC, treat the data as string. 2011-04-22 23:02:28 +09:00
Tatsuhiro Tsujikawa 46eced8ada Fixed compile error and unit test error without SSL library. 2011-03-17 16:08:39 +09:00
Tatsuhiro Tsujikawa 6e818a06dc Replaced gid_t with a2_gid_t cause gid_t is commonly used as group ID. 2011-03-17 12:17:46 +09:00
Tatsuhiro Tsujikawa 73572712d8 Use .meta4 instead of .metalink as suffix when saving metalink XML
uploaded by RPC.
2011-03-16 16:55:38 +09:00
Tatsuhiro Tsujikawa 15730aa560 Fixed the bug that JSONP callback function name is not encoded
properly.
2011-03-16 12:55:12 +09:00
Tatsuhiro Tsujikawa f999c2bcae Added test for JSON-RPC GET request without params parameter. 2011-03-16 12:51:43 +09:00
Tatsuhiro Tsujikawa f0cfbb21c1 Renamed classes in abstract layer of RPC service from XmlRpc* to Rpc*.
Now JSON-RPC is available by default regardless of XML library.
XML-RPC becomes available when XML library is available.
2011-03-14 16:38:54 +09:00
Tatsuhiro Tsujikawa 5a1fb3875f Added XmlRpcResponseTest. Set null as id if id is not sent.
Removed unused XmlRpcResponse::toJsonBatch(). Set default value false
to gzip argument of xmlrpc::toJsonBatch().
2011-03-14 15:31:26 +09:00
Tatsuhiro Tsujikawa bf01bb84b6 Added JSONP support. Callback query parameter is "jsoncallback". 2011-03-14 00:57:05 +09:00
Tatsuhiro Tsujikawa 7338a25035 Added initial JSON-RPC support.
JSON-RPC is enabled using --enable-xml-rpc. We are implementing
JSON-RPC based on JSON-RPC 2.0 draft spec.
2011-03-09 23:07:27 +09:00
Tatsuhiro Tsujikawa 7230fbd2f7 Replaced HAVE_LIBZ with HAVE_ZLIB 2011-02-18 22:34:38 +09:00
Tatsuhiro Tsujikawa 3f125dce21 Use LIBS and CPPFLAGS instead of substituting them individually per
library.
2011-02-18 18:53:53 +09:00
Tatsuhiro Tsujikawa 1698b2c7b1 Save downloads added by aria2.addTorrent or aria2.addMetalink in
--save-session file.

Uploaded data are saved as file named hex string of sha1 hash of
uploaded data plus extension(".torrent" for torrent and ".metalink"
for metalink). For example,
0a3893293e27ac0490424c06de4d09242215f0a6.torrent. The directory where
these files are saved is specified by --dir option. These file paths
are written in --save-session file.
2011-02-16 00:44:23 +09:00
Tatsuhiro Tsujikawa a21fb350a0 Fixed the bug that causes segmentation fault when unpause RequestGroup
which has resolved BtDependency.
2011-02-14 00:36:52 +09:00
Tatsuhiro Tsujikawa 656f8cf901 Don't calculate maxPeerListSize based on --bt-max-peers.
Always use MAX_PEER_LIST_SIZE by default.
2011-02-07 00:22:06 +09:00
Tatsuhiro Tsujikawa 2666bc8170 Renamed MessageDigestHelper as message_digest_helper
Static member variables in MessageDigestHelper class are now functions
under message_digest namespace.
2011-02-05 23:38:51 +09:00
Tatsuhiro Tsujikawa 38202a5565 Renamed MetalinkHelper as metalink_helper.
Static member functions in MetalinkHelper class is now functions under
metalink namespace.
2011-02-05 23:21:06 +09:00
Tatsuhiro Tsujikawa 8902c2a839 Rewritten DefaultPeerStorage::addPeer(const std::vector<SharedHandle<Peer> >&) 2011-01-31 23:00:05 +09:00
Tatsuhiro Tsujikawa 1b9329c67c Accept HTTP 304 reply as success when If-None-Match request-header
field is specified using --header option.

When --conditional-get is used, --allow-overwrite is now required to
overwrite existing file.
2011-01-29 23:19:10 +09:00
Tatsuhiro Tsujikawa 7a6ec762ef Added cast to time_t. 2011-01-29 21:36:00 +09:00
Tatsuhiro Tsujikawa 1d71626bea Supported multi-line HTTP header field value.
See http://tools.ietf.org/html/rfc2616#section-4.2
2011-01-20 00:25:01 +09:00
Tatsuhiro Tsujikawa 97d0b71dd4 Don't use SocketCore::isReadable() repeatedly.
We can know whether data is available by inspecting 2nd argument of
SocketCore::readData() because we use non-blocking I/O.
2011-01-16 21:04:31 +09:00
Tatsuhiro Tsujikawa ce2d401dce Eliminated SocketCore::peekData from MSEHandshake. 2011-01-09 18:34:06 +09:00
Tatsuhiro Tsujikawa 920583502e Consider IP address and port when finding DHT node. 2011-01-07 00:14:42 +09:00
Tatsuhiro Tsujikawa d429943d05 Fixed the bug that peer is marked as seeder whenever it sends
extension handshake with metadata size.

Peer must be marked as seeder only when client has not got metadata
yet. This bug causes aria2 shutdowns connection early when it gets
have message from a peer because it wrongly recognizes the peer as
seeder.
2011-01-06 22:43:34 +09:00
Tatsuhiro Tsujikawa 0a2b1660fa Removed DownloadContext::dir_. Use PREF_DIR value instead. 2010-12-03 13:08:22 +09:00
Tatsuhiro Tsujikawa 3ee6784b76 Made `make distcheck' pass.
We added 2 macros A2_TEST_DIR and A2_TEST_OUT_DIR to pass tests in
`make distcheck`.  A2_TEST_DIR refers to test directory.  All output
files by unit tests are now created under A2_TEST_OUT_DIR directory.
2010-12-02 22:52:35 +09:00
Tatsuhiro Tsujikawa 476ba70a9f Moved errorCode_ from RecoverableException to Exception and added errorCode to
stackTrace.

Also changed errno to errNum in stackTrace.
2010-11-28 21:36:01 +09:00
Tatsuhiro Tsujikawa d316a00ade Replaced RequestGroup::lastUriResult_ with
RequestGroup::lastErrorCode_.
2010-11-28 17:00:30 +09:00
Tatsuhiro Tsujikawa 947967fc63 Renamed DownloadErrorCode.h as error_code.h. Renamed
downloaderrorcode::Value as error_code::Value.
2010-11-28 16:52:02 +09:00
Tatsuhiro Tsujikawa e39dd96171 Removed autogenerated files by automake/autoconf.
To generate these files, run 'autoreconf -i'.

Since libgnutls.m4 is no longer distributed, we removed
AM_PATH_LIBGNUTLS from configure.ac.
2010-11-27 23:31:17 +09:00
Tatsuhiro Tsujikawa 0455cde2a8 2010-11-25 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Removed unused FileEntry::setupDir()
	* src/FileEntry.cc
	* src/FileEntry.h
	* test/FileEntryTest.cc
2010-11-25 12:42:07 +00:00
Tatsuhiro Tsujikawa 63c84509b9 2010-11-25 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed unittest error
	* test/OptionHandlerTest.cc
2010-11-25 12:14:17 +00:00
Tatsuhiro Tsujikawa ea49e9c297 2010-11-25 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Made strings which are only used in comparison plain C strings.
	* src/HttpHeader.cc
	* src/HttpHeader.h
	* src/Netrc.cc
	* src/Netrc.h
	* test/HttpHeaderTest.cc
2010-11-25 12:13:33 +00:00
Tatsuhiro Tsujikawa 06cd151c4b 2010-11-23 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Cleaned up Possible Values in usage help.  More than 2 values are
	delimited by ", ".
	* src/NameMatchOptionHandler.h
	* src/OptionHandler.cc
	* src/OptionHandler.h
	* src/OptionHandlerFactory.cc
	* src/OptionHandlerImpl.cc
	* test/OptionHandlerTest.cc
2010-11-23 14:47:58 +00:00
Tatsuhiro Tsujikawa 694fb307aa 2010-11-20 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Replaced StringFormat with fmt
2010-11-20 09:36:14 +00:00
Tatsuhiro Tsujikawa 1eef862cc3 2010-11-18 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Replaced BNode with DHTBucketTreeNode which is 2 times efficient.
	* src/BNode.cc: Removed
	* src/BNode.h: Removed
	* src/DHTBucketTree.cc
	* src/DHTBucketTree.h
	* src/DHTRoutingTable.cc
	* src/DHTRoutingTable.h
	* src/Makefile.am
	* test/BNodeTest.cc: Removed
	* test/DHTBucketTreeTest.cc
	* test/Makefile.am
2010-11-17 15:42:23 +00:00
Tatsuhiro Tsujikawa d8d159ccd8 2010-11-15 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Replaced HttpHeader::responseStatus_ with HttpHeader::statusCode_.
	statusCode_ is of type int.
	* src/AbstractProxyResponseCommand.cc
	* src/FtpNegotiationCommand.cc
	* src/HttpHeader.cc
	* src/HttpHeader.h
	* src/HttpHeaderProcessor.cc
	* src/HttpResponse.cc
	* src/HttpResponse.h
	* src/HttpResponseCommand.cc
	* src/HttpSkipResponseCommand.cc
	* src/util.cc
	* src/util.h
	* test/HttpHeaderProcessorTest.cc
	* test/HttpHeaderTest.cc
	* test/HttpResponseTest.cc
	* test/UtilTest.cc
2010-11-15 12:52:03 +00:00
Tatsuhiro Tsujikawa 1372ac51ad 2010-11-14 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added .cc file for classes/structs that only provided by header
	file. Defined non-POD classes' ctor, dtor in .cc file.  Moved
	implementation code in header file to .cc file for major
	classes/strucsts.
2010-11-14 07:17:55 +00:00
Tatsuhiro Tsujikawa 93e5dbed32 2010-11-12 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Removed SharedHandle::isNull(). Instead we added operator* and
	operator unspecified_bool_type. Removed use of WeakHandle and
	replaced with raw pointer.
2010-11-12 12:48:48 +00:00
Tatsuhiro Tsujikawa bc98e39fe5 2010-11-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
To match the behavior of friend operator functions in
	SharedHandle.h to std::tr1::shared_ptr, we intentionally broke
	these functions and modified code so that our code does not depend
	on old behavior.
	* src/AbstractCommand.cc
	* src/DHTAbstractNodeLookupTask.h
	* src/DHTBucket.cc
	* src/DHTMessageReceiver.cc
	* src/DHTNodeLookupEntry.cc
	* src/DHTRoutingTable.cc
	* src/DefaultBtRequestFactory.cc
	* src/DefaultPeerStorage.cc
	* src/DefaultPieceStorage.cc
	* src/DownloadContext.cc
	* src/EpollEventPoll.cc
	* src/Event.h
	* src/HttpConnection.cc
	* src/KqueueEventPoll.cc
	* src/MultiDiskAdaptor.cc
	* src/PeerAbstractCommand.cc
	* src/PieceStatMan.cc
	* src/PollEventPoll.cc
	* src/PortEventPoll.cc
	* src/SegmentMan.cc
	* src/SelectEventPoll.cc
	* src/SelectEventPoll.h
	* src/ServerStatMan.cc
	* src/SharedHandle.h
	* src/UnknownLengthPieceStorage.cc
	* src/a2functional.h
	* src/option_processing.cc
	* src/version_usage.cc
	* test/BNodeTest.cc
	* test/DHTAnnouncePeerMessageTest.cc
	* test/DHTBucketTest.cc
	* test/DHTFindNodeMessageTest.cc
	* test/DHTGetPeersMessageTest.cc
	* test/DHTIDCloserTest.cc
	* test/DHTMessageFactoryImplTest.cc
	* test/DHTPingMessageTest.cc
	* test/DefaultBtRequestFactoryTest.cc
	* test/DefaultPeerStorageTest.cc
	* test/SequentialPickerTest.cc
	* test/SingletonHolderTest.cc
2010-11-11 07:33:43 +00:00
Tatsuhiro Tsujikawa 89f997ec0d 2010-11-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Replaced MessageDigestContext with MessageDigest.  Cleaned up
	unnecessary functions in MessageDigestHelper.
	* src/BtPieceMessage.cc
	* src/Checksum.h
	* src/DHTTokenTracker.cc
	* src/DownloadCommand.cc
	* src/DownloadCommand.h
	* src/HashFuncEntry.h
	* src/IteratableChecksumValidator.cc
	* src/IteratableChecksumValidator.h
	* src/IteratableChunkChecksumValidator.cc
	* src/IteratableChunkChecksumValidator.h
	* src/LibgcryptMessageDigestImpl.cc
	* src/LibgcryptMessageDigestImpl.h
	* src/LibsslMessageDigestImpl.cc
	* src/LibsslMessageDigestImpl.h
	* src/MSEHandshake.cc
	* src/MSEHandshake.h
	* src/Makefile.am
	* src/MessageDigest.cc
	* src/MessageDigest.h
	* src/MessageDigestHelper.cc
	* src/MessageDigestHelper.h
	* src/MessageDigestImpl.h
	* src/MetalinkParserController.cc
	* src/Piece.cc
	* src/Piece.h
	* src/UTMetadataDataExtensionMessage.cc
	* src/bittorrent_helper.cc
	* src/messageDigest.cc: Removed
	* src/messageDigest.h: Removed
	* src/util.cc
	* src/version_usage.cc
	* test/BittorrentHelperTest.cc
	* test/GZipDecoderTest.cc
	* test/GZipDecodingStreamFilterTest.cc
	* test/IteratableChecksumValidatorTest.cc
	* test/IteratableChunkChecksumValidatorTest.cc
	* test/Makefile.am
	* test/MessageDigestHelperTest.cc
	* test/MessageDigestTest.cc
	* test/Metalink2RequestGroupTest.cc
	* test/MetalinkProcessorTest.cc
	* test/PieceTest.cc
	* test/TestUtil.cc
	* test/TestUtil.h
	* test/UTMetadataDataExtensionMessageTest.cc
	* test/UTMetadataPostDownloadHandlerTest.cc
2010-11-11 02:56:24 +00:00
Tatsuhiro Tsujikawa 35cc4ed1e7 2010-10-31 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Return empty range if byte-range-resp-spec or instance-length is
	"*" in Content-Range header to prevent aria2 from emitting error
	failing to convert "*" to a integer.
	* src/HttpHeader.cc
	* test/HttpHeaderTest.cc
2010-10-31 07:56:01 +00:00
Tatsuhiro Tsujikawa 2b458da480 2010-10-31 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Made #include guard consistent for c++ header files.
2010-10-31 07:23:53 +00:00
Tatsuhiro Tsujikawa 236e64cb25 2010-10-30 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Use unnamed namespace instead of static keyword.
	* src/AbstractCommand.cc
	* src/AdaptiveURISelector.cc
	* src/Base64.cc
	* src/BitfieldMan.cc
	* src/BtDependency.cc
	* src/ConsoleStatCalc.cc
	* src/ContentTypeRequestGroupCriteria.cc
	* src/CookieStorage.cc
	* src/DHTMessageFactoryImpl.cc
	* src/DHTRoutingTableDeserializer.cc
	* src/DefaultBtAnnounce.cc
	* src/DefaultBtProgressInfoFile.cc
	* src/DefaultPeerStorage.cc
	* src/DefaultPieceStorage.cc
	* src/DownloadCommand.cc
	* src/DownloadEngine.cc
	* src/EpollEventPoll.cc
	* src/ExpatMetalinkProcessor.cc
	* src/ExpatXmlRpcRequestProcessor.cc
	* src/FileEntry.cc
	* src/HttpRequest.cc
	* src/HttpRequestCommand.cc
	* src/HttpResponseCommand.cc
	* src/KqueueEventPoll.cc
	* src/LongestSequencePieceSelector.cc
	* src/MetalinkParserStateV3Impl.cc
	* src/MetalinkParserStateV4Impl.cc
	* src/MultiDiskAdaptor.cc
	* src/MultiUrlRequestInfo.cc
	* src/OptionParser.cc
	* src/PeerSessionResource.cc
	* src/PortEventPoll.cc
	* src/Request.cc
	* src/RequestGroupMan.cc
	* src/SelectEventPoll.cc
	* src/SessionSerializer.cc
	* src/SimpleLogFormatter.cc
	* src/Sqlite3CookieParser.cc
	* src/TrackerWatcherCommand.cc
	* src/XML2SAXMetalinkProcessor.cc
	* src/Xml2XmlRpcRequestProcessor.cc
	* src/XmlRpcMethod.cc
	* src/XmlRpcMethodImpl.cc
	* src/XmlRpcResponse.cc
	* src/base32.cc
	* src/bencode2.cc
	* src/bittorrent_helper.cc
	* src/download_helper.cc
	* src/main.cc
	* src/messageDigest.cc
	* src/option_processing.cc
	* src/util.cc
	* test/AnnounceListTest.cc
	* test/BtRegistryTest.cc
	* test/DHTBucketTest.cc
	* test/DHTRoutingTableTest.cc
	* test/DefaultBtAnnounceTest.cc
	* test/FileEntryTest.cc
	* test/FtpConnectionTest.cc
	* test/MSEHandshakeTest.cc
	* test/MagnetTest.cc
	* test/XmlRpcMethodTest.cc
	* test/array_funTest.cc
2010-10-30 16:02:15 +00:00
Tatsuhiro Tsujikawa 423ec26fe4 2010-10-26 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Use std::numeric_limits<time_t> instead of checking of
	sizeof(time_t).
	* src/NsCookieParser.cc
	* src/Sqlite3CookieParser.cc
	* src/cookie_helper.cc
	* test/CookieHelperTest.cc
	* test/CookieStorageTest.cc
	* test/NsCookieParserTest.cc
2010-10-27 14:54:25 +00:00
Tatsuhiro Tsujikawa 4516736a22 2010-10-12 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added testcase for File::mkdirs().
	* test/FileTest.cc
2010-10-11 15:15:51 +00:00
Tatsuhiro Tsujikawa 96ee327bf3 2010-10-10 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed compile error without sqlite3
	* test/CookieStorageTest.cc
2010-10-10 14:05:08 +00:00
Tatsuhiro Tsujikawa f6dbba5427 2010-10-10 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Retrieve last access time from sqlite3 cookie database.
	* src/CookieStorage.cc
	* src/Sqlite3CookieParser.cc
	* src/Sqlite3CookieParser.h
	* src/Sqlite3CookieParserImpl.cc
	* test/Sqlite3CookieParserTest.cc
	* test/chromium_cookies.sqlite
	* test/cookies.sqlite
2010-10-10 09:53:30 +00:00
Tatsuhiro Tsujikawa 0abd4a2f7b 2010-10-10 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Rewritten util::split()
	* src/util.h
	* test/UtilTest.cc
2010-10-10 06:58:31 +00:00