Commit Graph

2490 Commits (847ebd54bcc610e8c83e713a39e9a8527240515f)

Author SHA1 Message Date
Tatsuhiro Tsujikawa ad4065ca12 Increased max # of in-flight request in BitTorrent. 2011-07-16 00:24:29 +09:00
Tatsuhiro Tsujikawa 44c379eaa8 Do nothing if block has already acquired.
This happens in end-game mode.
2011-07-16 00:23:45 +09:00
Tatsuhiro Tsujikawa 5703835784 Use GNUTLS_SHUT_WR instead of GNUTLS_SHUT_RDWR
We don't read the response from peer about this.
2011-07-06 22:52:15 +09:00
Tatsuhiro Tsujikawa 6f602e2809 Call shutdown() with SHUT_WR before close to avoid TCP RST. 2011-07-06 22:51:20 +09:00
Tatsuhiro Tsujikawa d2e76eca47 Don't search faster server using ServerStatMan if req_ is null or
total length is unknown.
2011-06-29 21:30:32 +09:00
Tatsuhiro Tsujikawa 45430983d8 Move URI to spendUris_ when it is selected in
FileEntry::findFasterRequest().
2011-06-28 22:38:31 +09:00
Tatsuhiro Tsujikawa bd4d3a27b3 Assign global::wallclock instead of calling Timer::reset(). 2011-06-28 22:30:40 +09:00
Tatsuhiro Tsujikawa 5d498cb1ab Take into account PREF_MAX_CONNECTION_PER_SERVER in
findFasterRequest(...,serverStatMan).
2011-06-28 21:27:31 +09:00
Tatsuhiro Tsujikawa 2906484345 Use ServerStat to find faster server. 2011-06-28 00:21:29 +09:00
Tatsuhiro Tsujikawa 0f0d4b9a48 Documented that falloc can be used against NTFS(MinGW build only). 2011-06-20 23:28:19 +09:00
Tatsuhiro Tsujikawa cc7bc0aad3 Added aria2.getGlobalStat RPC method.
It returns overall download/upload speed and the number of
active/stopped/waiting downloads.
2011-06-17 22:45:42 +09:00
Tatsuhiro Tsujikawa bb7e2e69db Call requestQueueCheck() even if reservedGroups_ is not empty. 2011-06-16 22:36:20 +09:00
Tatsuhiro Tsujikawa 58b9655ad4 Call requestQueueCheck() even if reservedGroups_ is not empty.
This is because if all downloads in reservedGroups_ are in paused
state, we have to call requestQueueCheck() for each new added
download.
2011-06-16 22:01:14 +09:00
Tatsuhiro Tsujikawa bea21e0afa Added --stream-piece-selector option to -i list option. 2011-06-16 21:45:47 +09:00
Tatsuhiro Tsujikawa d5c2ef4ce9 Added --pause option.
This option pauses download after added. This option is effective only
when --enable-rpc=true is given.  When --save-session option is used
and there are paused downloads, they are saved with --pause=true so
that it will become paused state when the session is recovered.
2011-06-16 21:37:15 +09:00
Tatsuhiro Tsujikawa c0d1e98133 Abort aria2 if it could not setup any RPC server. 2011-06-15 22:19:09 +09:00
Tatsuhiro Tsujikawa 561dafc942 Added --truncate-console-readout option.
This option truncates console readout to fit in a single line.  This
is default. Give false value to this option to tell aria2 not to
truncate console readout.
2011-06-15 20:27:14 +09:00
Tatsuhiro Tsujikawa e3e7a420de Cache and reuse RpcMethod objects. 2011-06-15 20:07:10 +09:00
Tatsuhiro Tsujikawa d1885a5874 Allowed missing params in system.multicall RPC method. 2011-06-15 00:42:50 +09:00
Tatsuhiro Tsujikawa 2d92571cf9 Moved jsonRpc flag from RpcMethod to RpcRequest.
Now RpcMethod is stateless, so we can cache and reuse them.
2011-06-15 00:19:07 +09:00
Tatsuhiro Tsujikawa ba9673be1d Initialized member variables of DownloadResult in its ctor. 2011-06-12 00:51:36 +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 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 533cdfa850 Removed unnecessary template parameter from std::make_pair call.
The patch was contributed from Dan Fandrich.
2011-06-10 21:11:03 +09:00
Tatsuhiro Tsujikawa 51dc544f2b Logged invoked RPC method name. 2011-06-07 23:33:04 +09:00
Tatsuhiro Tsujikawa e958f5dab3 Implemented fast file allocation in MinGW32 build.
We use SetFilePointerEx and SetEndOfFile to allocate extents.  This
only works with NTFS. To enable this feature, --file-allocation=falloc
must be given.
2011-06-07 01:09:38 +09:00
Tatsuhiro Tsujikawa 867cab6df1 Small code cleanup 2011-06-01 01:43:31 +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 74a049ddfc Don't throw exception if Z_BUF_ERROR is encountered in
GZipDecodingFilter.
2011-05-30 23:10:06 +09:00
Tatsuhiro Tsujikawa 34207cda01 Don't throw exception if Z_BUF_ERROR is encountered in GZipEncoder. 2011-05-30 23:04:48 +09:00
Tatsuhiro Tsujikawa 70b7394b21 Updated doc for --save-session option. 2011-05-29 21:07:27 +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 c6b71eac8f Updated doc for --save-session option. 2011-05-19 19:01:17 +09:00
Tatsuhiro Tsujikawa 4dc71647f8 Added --metalink-base-uri option to -i list options. 2011-05-16 22:45:53 +09:00
Tatsuhiro Tsujikawa 653f04ef5c Add CreateRequestCommand with STATUS_INACTIVE instead of SleepCommand
+ DownloadFailureException.

Throwing DownloadFailureException may stop download unexpectedly when
--reuse-uri is false. Using CreateRequestCommand with STATUS_INACTIVE,
they can be executed next iteration with
DownloadEngine::setRefreshInterval(0).
2011-05-16 22:01:49 +09:00
Tatsuhiro Tsujikawa c9fe4c64f5 Added relative URI support to ExpatMetalinkProcessor 2011-05-16 01:37:19 +09:00
Tatsuhiro Tsujikawa 49b49c351a Eliminated few seconds delay when downloads stop or pause.
The delay is caused because some Commands are only called in certain
interval(called refreshInterval, default, 1000ms). In aria2 download
stops when all Commands associated to it are stopped. Since some
Commands are called in each 1000ms by default, as mentioned before, we
have to wait for them.  To fix this issue, we call
DownloadEngine::setRefreshInterval(0) when pausing/stopping downloads.
DownloadEngine::setRefreshInterval(0) makes refreshInterval 0 in one
shot.

When all segments are ignored, now DownloadFailureException is thrown.
And stop the download immediately. As described earlier, we call
DownloadEngine::setRefreshInterval(0) in catch block of
DownloadFailureException to eliminate delay.
2011-05-15 23:35:06 +09:00
Tatsuhiro Tsujikawa 49b032800f Added --metalink-base-uri option.
--metalink-uri option specifies base URI to resolve relative URI in
metalink file stored in local disk. If URI points to a directory, URI
must end with '/'.
2011-05-14 22:52:54 +09:00
Tatsuhiro Tsujikawa ed589ab034 Run batch file with cmd.exe. Quoted user command.
It seems that we have to specify the full path to cmd.exe in the first
argument of CreateProcess() to run batch file in proper manner.  We
first determine the full path to cmd.exe. To do this, we get windir
environment variable and concatenate it with "\system32\cmd.exe".
2011-05-14 21:27:31 +09:00
Tatsuhiro Tsujikawa 286991e17d Strip DQUOTE from cookie-value and updated doc. 2011-05-14 21:24:10 +09:00
Tatsuhiro Tsujikawa 3026b18ecd Updated doc 2011-05-14 21:23:59 +09:00
Tatsuhiro Tsujikawa 00fa59d0f5 Fixed the bug that the message "Loaded cookies from ..." appears when
loading cookies from that file failed.
2011-05-12 09:39:03 +09:00
Tatsuhiro Tsujikawa 990a9e6d8e Applied patch from Dan Fandrich.
Thanks to Dan Fandrich.
I modified some lines to suite my taste.
2011-05-07 18:48:58 +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 11d7e4fa46 Set DownloadEngine::setNoWait(true) in SleepCommand. 2011-04-30 23:45:17 +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 2c0476e6d9 Erase user and password specified in command-line from argv.
The user and password is masked with '*'.
2011-04-22 23:38:59 +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 aabb1f963e Removed condition always evaluated to true. 2011-03-29 23:22:36 +09:00
Tatsuhiro Tsujikawa 891c9e60ac Use A2_DELTA_MILLIS for timing critical code. 2011-03-27 20:54:51 +09:00
Tatsuhiro Tsujikawa a4ddec44d1 Fixed typo 2011-03-27 19:19:33 +09:00
Tatsuhiro Tsujikawa 6e3f512c61 Added --show-console-readout option.
This option toggles appearance of console readout.
2011-03-27 19:16:54 +09:00
Tatsuhiro Tsujikawa 60a21e672c Fixed compile error 2011-03-21 11:34:35 +09:00
Tatsuhiro Tsujikawa 87ca37ea48 Log error when event polling function failed. 2011-03-20 15:22:42 +09:00
Tatsuhiro Tsujikawa e95b8efc6b Fixed the bug that microsecond part of timeval overwlows in waitData(). 2011-03-20 15:00:13 +09:00
Tatsuhiro Tsujikawa d8585fd6eb Updated doc 2011-03-18 22:45:25 +09:00
Tatsuhiro Tsujikawa c1c3f2d77a Return text/javascript as Content-Type if jsoncallback is given. 2011-03-18 22:43:01 +09:00
Tatsuhiro Tsujikawa 3d2fa5954e Rewritten SocketBuffer::BufEntry and SocketBuffer::send() 2011-03-18 17:20:37 +09:00
Tatsuhiro Tsujikawa 18d51a3e20 Removed logging RPC request. 2011-03-17 16:09:22 +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 821dbbff1f Fixed compile error with --disable-bittorrent 2011-03-17 16:02:35 +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 b9a37f48cf Updated doc. 2011-03-16 16:56:33 +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 046bee87a2 Code cleanup 2011-03-16 12:56:03 +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 dfdf98d2f7 Fixed segmentation fault when JSON-RPC request cannot be parsed or is
invalid.
2011-03-16 12:53:40 +09:00
Tatsuhiro Tsujikawa bb9ad97c5c Allow empty params in GET request. 2011-03-16 12:50:39 +09:00
Tatsuhiro Tsujikawa da0ab67324 Delegate jsonRpc_ to child method in system.multicall. 2011-03-16 00:29:39 +09:00
Tatsuhiro Tsujikawa 3ddb68f340 Deprecated --enable-xml-rpc and --xml-rpc-* option. Introduced
--enable-rpc and --rpc-* option instead.

--enable-xml-rpc and --xml-rpc-* option can be used but warning
message will be shown. The help tag #xml-rpc was replaced with #rpc.
2011-03-14 21:02:25 +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 feb4e2e53a Hide operator<<(char c); 2011-03-14 00:54:14 +09:00
Tatsuhiro Tsujikawa b46e7a953b encodeJsonAll: Fixed stream error when gzip=true. 2011-03-14 00:53:16 +09:00
Tatsuhiro Tsujikawa 8a9fa9a692 Added JSON-RPC 2.0 batch call. 2011-03-10 00:56:37 +09:00
Tatsuhiro Tsujikawa bc7ac15d7e Fixed error message in json::decode() 2011-03-10 00:54:07 +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 d541b350d2 Set DEFAULT_REFRESH_INTERVAL 1000 to update console readout more
smoothly.
2011-02-26 23:16:48 +09:00
Tatsuhiro Tsujikawa 59f251ba14 Fixed rounding error in DownloadEngine::run().
This fixes the bug that executeCommand() with Command::STATUS_ALL is
not called in every interval correctly because of rounding error in
timer.
2011-02-25 22:58:51 +09:00
Tatsuhiro Tsujikawa f8f651e8db Refresh buckets at DHT initialization without checking serialized
time.

Checking serialized time does not work if you stop aria2 as soon as it
started DHT. The serialized time in dht.dat will be updated, but
buckets are not updated and still old. When you restart aria2 again,
it does not refresh buckets because serialized time is recent.
2011-02-25 22:39:14 +09:00
Tatsuhiro Tsujikawa 655b59e350 Retry get_peers if connection is low.
To eliminate unresponsive node, we have to contact them 5
times. Therefore the maximum number of retry is 10. It is very
annoying when it takes some time to get first peer, so retry quickly
(5 seconds delay).
2011-02-25 00:34:50 +09:00
Tatsuhiro Tsujikawa f16aef227d Fixed compile error with c-ares 1.7.0 2011-02-19 01:57:16 +09:00
Tatsuhiro Tsujikawa b21cce0002 Use pkg-config for libcares. Dropped c-ares pre-1.5 support. 2011-02-18 23:36:39 +09:00
Tatsuhiro Tsujikawa 395212f47f Replaced HAVE_LIBSSL with HAVE_OPENSSL 2011-02-18 22:43:50 +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 d3d1293974 Check the availability of ares_set_servers and ares_addr_node. 2011-02-18 01:04:11 +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 eb6a811279 Look for USERPROFILE and the combination of HOMEDRIVE and HOMEPATH to
get user's home directory in MinGW32 build.

Usually HOME environment variable is defined in *nix like OSes, but
not in Windows. So in MinGW32 build, if HOME is not defined, we also
look for USERPROFILE and the combination of HOMEDRIVE and HOMEPATH.
2011-02-12 18:38:13 +09:00
Tatsuhiro Tsujikawa 22a6ec6a15 Fixed the bug that DownloadContext::basePath_ is not
escaped. Percent-encode non UTF-8 strings in torrent file and Magnet
URI.
2011-02-12 00:15:33 +09:00
Tatsuhiro Tsujikawa 1a9d3b7711 Added Date, Expires and Cache-Control response header field to XML-RPC response headers. 2011-02-09 23:01:01 +09:00
Tatsuhiro Tsujikawa ffce1848ca Don't retry peer lookup.
We can handle shortage of peer by short interval.
2011-02-08 23:39:44 +09:00
Tatsuhiro Tsujikawa aa4232ca8b Use rp instead of res. 2011-02-08 23:14:13 +09:00
Tatsuhiro Tsujikawa 297858280b Moved PREF_ASYNC_DNS_SERVER to the next to PREF_ASYNC_DNS. 2011-02-08 23:08:44 +09:00
Tatsuhiro Tsujikawa f0682a98c0 Added --async-dns-server option.
This option accepts comma separated list of DNS server address used in
asynchronous DNS resolver. Usually asynchronous DNS resolver reads DNS
server addresses from /etc/resolv.conf. When this option is used, it
uses DNS servers specified in this option instead of ones in
/etc/resolv.conf. You can specify both IPv4 and IPv6 address. This
option is useful when the system does not have /etc/resolv.conf and
user does not have the permission to create it.
2011-02-08 23:05:40 +09:00
Tatsuhiro Tsujikawa cf546810e4 Don't call DownloadEngine::markBadIPAddress() when DNS query was timeout. 2011-02-08 22:46:22 +09:00
Tatsuhiro Tsujikawa af4e47329b Call calculateStatistics() after global::wallclock.reset().
Inside calculateStatistics(), global::wallclock is used and if
calculateStatistics() is called after waitData(), it may use quite old
global::wallclock value.
2011-02-08 00:16:29 +09:00
Tatsuhiro Tsujikawa 3574f6bd7d Accept https:// and ftp:// in proxy options and environment variables. 2011-02-07 22:59:04 +09:00
Tatsuhiro Tsujikawa 954d595ee8 Code cleanup 2011-02-07 21:43:38 +09:00
Tatsuhiro Tsujikawa 97fde60f3e Added upper limit of the number of peer added by each addPeer(vector) call. 2011-02-07 21:38:51 +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 6c44f6b8eb Removed unused member variable peers_. 2011-02-07 00:19:07 +09:00
Tatsuhiro Tsujikawa 8eb1de9ef8 Get peers from DHT more frequently when the size of peer list is 0. 2011-02-07 00:17:44 +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 2373c62205 Moved some static member variables which are not exposed as public to unnamed namespace. 2011-02-05 23:08:03 +09:00
Tatsuhiro Tsujikawa 8902c2a839 Rewritten DefaultPeerStorage::addPeer(const std::vector<SharedHandle<Peer> >&) 2011-01-31 23:00:05 +09:00
Tatsuhiro Tsujikawa 27974108f0 Fixed overflow in the calculation of progress percentage for file
allocation and hash check when off_t is 32bit.
2011-01-30 23:28:10 +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 2ba2511dd5 Check presence of ar.
This change allows configure to find appropriate ar at cross compile.
2011-01-29 21:33:57 +09:00
Tatsuhiro Tsujikawa b49a558c4e Fixed compile error on 32bit systems. 2011-01-27 21:21:37 +09:00
Tatsuhiro Tsujikawa 43dd3861a5 Updated copyright year. 2011-01-20 00:59:06 +09:00
Tatsuhiro Tsujikawa fe40876546 Added aria2.removeDownloadResult XML-RPC method.
The method signature is aria2.removeDownloadResult(gid).  This method
removes completed/error/removed download denoted by gid from
memory. This method returns "OK" for success.
2011-01-20 00:56:34 +09:00
Tatsuhiro Tsujikawa 1ea01e84b2 Use IP address of data connection to connect to the remote server in
passive mode.
2011-01-20 00:30:01 +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 2873953f30 Changed the default value of --retry-wait to 0 for backward
compatibility.

Also updated usage doc.
2011-01-18 21:22:59 +09:00
Tatsuhiro Tsujikawa 426e57a180 Don't check permission of .netrc file in MinGW32 build. 2011-01-17 22:36:19 +09:00
Tatsuhiro Tsujikawa b0ed9b3bd1 Added retry-wait option to -i list options. 2011-01-17 21:25:17 +09:00
Tatsuhiro Tsujikawa f2a63fa06a Added --retry-wait option.
This option was once existed in aria2 but erased on 2009-09-20.  Now
it is resurrected once again.  We choose 2 as default value, but there
is no good theory behind it.  Now we retry HTTP download when remote
server returns 503 Service Unavailable if --retry-wait > 0. We also
added error code 29: HTTP_SERVICE_UNAVAILABLE.
2011-01-17 21:19:45 +09:00
Tatsuhiro Tsujikawa 4824b09237 Reverted comment which was removed unintentionally. Moved 2
DownloadEngine related lines outside of #ifdef ENABLE_MESSAGE_DIGEST.
2011-01-16 22:35:30 +09:00
Tatsuhiro Tsujikawa 90d94953d7 Don't show metadata download and paused download in "Download Results". 2011-01-16 22:20:29 +09:00
Tatsuhiro Tsujikawa 9fe35495fd Fixed doc 2011-01-16 21:16:56 +09:00
Tatsuhiro Tsujikawa 2c3187451f Don't pool connection if the command has multiple segments.
This means it did HTTP pipelined request. If this response is for the
first request, then successive response may arrived to the socket.
2011-01-16 21:05:14 +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 63fe7874da Handle the situation when remote server returns Connection: close
after several pipelined requests.

We call Request::setMaxPipelinedRequest(1) if Connection: close is
received. Also call Request::supportsPersistentConnection(true) and
Request::setMaxPipelinedRequest(1) when closing the connection.
2011-01-16 18:12:14 +09:00
Tatsuhiro Tsujikawa b2f27e6548 Check !SocketRecvBuffer::bufferEmpty() in ctor.
Also treat !SocketRecvBuffer::bufferEmpty() as data is available.
2011-01-16 17:52:18 +09:00
Tatsuhiro Tsujikawa e60181d1ad Removed SocketCore::peekData() 2011-01-16 17:41:17 +09:00
Tatsuhiro Tsujikawa 629099d40d Eliminated SocketCore::peekData() from HttpServer. 2011-01-16 17:27:01 +09:00
Tatsuhiro Tsujikawa d030dd5a3f Code cleanup 2011-01-16 17:26:46 +09:00
Tatsuhiro Tsujikawa ea1b4b3ee5 Eliminated SocketCore::peekData() form HTTP/FTP downloads.
We introduced SocketRecvBuffer which buffers received bytes. Since
HTTP response header and response body are divided with \r\n, we have
to buffer up several bytes to find this delimiter. We use
SocketRecvBuffer to hold these bytes and only consumes header and
passes SocketRecvBuffer, which may contain head of response body, to
next Command.  Since FTPConnection doesn't use SocketCore::peekData(),
we left it as is.
2011-01-16 16:55:41 +09:00
Tatsuhiro Tsujikawa 3e67079087 Rewritten NAT check handling.
We simplified PeerConnection::receiveHandshake().
DefaultBtMessageReceiver and PeerReceiverHandshakeCommand look
PeerConnection's buffer and do NAT check handling themselves.
2011-01-09 23:57:07 +09:00
Tatsuhiro Tsujikawa 1818f2ed55 Just preset IA to PeerConnection in receiver side.
Since initiator cannot send payload stream before reading step2 from
receiver, mseHandshake_->getBufferLength() should be 0.
2011-01-09 18:34:06 +09:00
Tatsuhiro Tsujikawa 320ca4c5a1 Throw exception if more than BtHandshakeMessage::MESSAGE_LENGTH is
buffered when receiving handshake. Detect preset buffer without
setting prevPeek_ = true.
2011-01-09 18:34:06 +09:00
Tatsuhiro Tsujikawa e5c27034f3 Added assertion in shiftBuffer to check size. 2011-01-09 18:34:06 +09:00
Tatsuhiro Tsujikawa 02ca3ed0b7 Use refreshInterval_ as timeout value of event polling.
refreshInterval_ is now limited less than 1000ms.
2011-01-09 18:34:06 +09:00
Tatsuhiro Tsujikawa 781a4220fc Bump up DHT version number to 3. 2011-01-09 18:34:06 +09:00
Tatsuhiro Tsujikawa a2a91a2c74 Shorten MAX_BUFFER_LENGTH of MSEHandshake. 2011-01-09 18:34:06 +09:00
Tatsuhiro Tsujikawa 2ee68ec8ad Drop connection if IA length > 68 (BtHandshakeMessage::MESSAGE_LENGTH). 2011-01-09 18:34:06 +09:00
Tatsuhiro Tsujikawa acfb290eca We don't need to call PeerConnection::sendPendingData() twice when
sending piece message.
2011-01-09 18:34:06 +09:00
Tatsuhiro Tsujikawa 3020087a75 Don't try legacy BitTorrent handshake when connection did not established. 2011-01-09 18:34:06 +09:00
Tatsuhiro Tsujikawa ce2d401dce Eliminated SocketCore::peekData from MSEHandshake. 2011-01-09 18:34:06 +09:00
Tatsuhiro Tsujikawa c48db2cdf3 Fixed the bug that making directory fails on Windows OS.
On Windows, stat("C:/test/", ...) fails because of trailing "/".
To handle "\" as path separator, "\" are replaced with "/"
beforehand.
2011-01-09 18:27:08 +09:00
Tatsuhiro Tsujikawa a9f734218f Don't send announce_peer message with empty token in
DHTPeerLookupTask. Replace old node ID with new node ID when response
message is received in DHTAbstractNodeLookupTask.
2011-01-07 00:22:43 +09:00
Tatsuhiro Tsujikawa 2dba2f86a4 Drop old node from DHT routing table if node ID has changed. 2011-01-07 00:20:58 +09:00
Tatsuhiro Tsujikawa 653951f70a Drop connection if client and peer are both seeders. 2011-01-07 00:20:10 +09:00
Tatsuhiro Tsujikawa b6d5c389b8 Added missing include. 2011-01-07 00:19:10 +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 e818f9c8a5 Use %lx for DWORD.
GetLastError() returns DWORD, not C-String.
2010-12-19 00:24:36 +09:00
Tatsuhiro Tsujikawa b04e0bae6b Moved #include <gettext.h> inside of #ifdef ENABLE_NLS.
If we put #include <gettext.h> outside of #ifdef ENABLE_NLS and
--disable-nls is used, gettext(msgid) is defined as ((const char *)
(Msgid)). System header includes libintl.h regardless of
--disable-nls. For example, #include <string> will include libintl.h
through include chain. Since libintl.h refers gettext and it is
defined as non-function form, this causes compile error. User reported
gcc-4.2.2 has this problem. But gcc-4.4.5 does not suffer from this
problem.
2010-12-15 22:33:26 +09:00
Tatsuhiro Tsujikawa 5856d9252b Updated doc. 2010-12-10 21:50:23 +09:00
Tatsuhiro Tsujikawa 94ee6d6895 Updated doc 2010-12-10 21:34:24 +09:00
Tatsuhiro Tsujikawa 9e70c5ead7 Fixed typo 2010-12-10 21:29:50 +09:00
Tatsuhiro Tsujikawa 418c04c94c Fixed typo 2010-12-09 21:59:35 +09:00
Tatsuhiro Tsujikawa 3d0764eb9d Added comment. 2010-12-09 21:49:00 +09:00
Tatsuhiro Tsujikawa 31ec5ddf92 Updated help text for --input-file option.
Removed reference of --out and --dir option. It is a regacy before we
supported many other options.
2010-12-08 22:54:20 +09:00
Tatsuhiro Tsujikawa 235b5a0848 Allocate buffer used by DownloadCommand in stack. 2010-12-08 20:41:12 +09:00
Tatsuhiro Tsujikawa 9103fb6105 Refactored PieceStatMan::updatePieceStats(). 2010-12-07 01:08:11 +09:00
Tatsuhiro Tsujikawa 829803d4f5 Fixed compile error which occurs when system has posix_fallocate() but
does not have fallocate().
2010-12-05 23:47:35 +09:00
Tatsuhiro Tsujikawa da8e0203b8 Removed specializations of std::swap(PeerEntry&, PeerEntry&).
Declaring std::swap(PeerEntry&, PeerEntry&) in class declaration
breaks under Mac OS X 10.5. They are also not used. So we simply
removed them.
2010-12-05 23:19:37 +09:00
Tatsuhiro Tsujikawa 55e49b65d3 Use errno to get error code epoll_ctl(). Using its returned value as
error code is simply wrong.
2010-12-05 23:13:09 +09:00
Tatsuhiro Tsujikawa bc798ae4e6 Use Exception::getErrorCode() in main() instead of error_code::UNKNOWN_ERROR
unconditionally.
2010-12-05 15:13:32 +09:00
Tatsuhiro Tsujikawa 0271ec0352 Updated usage of --on-download-* options. 2010-12-04 22:42:24 +09:00
Tatsuhiro Tsujikawa adcfffeccb Fixed arithmetic exception when completedLength is 0. 2010-12-04 20:56:52 +09:00
Tatsuhiro Tsujikawa f3e89651a8 Return true if completedLength is 0. 2010-12-04 20:56:14 +09:00
Tatsuhiro Tsujikawa c5ef9dadbd Pass the number of requested files as 2nd argument to the command specified in
--on-download-* hook.

As a consequence, first filename is passed as 3rd argument.
2010-12-04 19:00:48 +09:00
Tatsuhiro Tsujikawa 0cdfc3d104 Call RequestGroupMan::removeStoppedGroup() in
DownloadEngine::onEndOfRun() to process RequestGroup objects currently
in-progress.

With this change, --on-download-stop/error/complete hooks are properly
called for in-progress downloads when Ctrl-C is pressed.
2010-12-04 18:24:38 +09:00
Tatsuhiro Tsujikawa 567b424907 Pass first filename as 2nd argument to command specified by
--on-download-* option.
2010-12-04 18:14:27 +09:00
Tatsuhiro Tsujikawa c03ab007a3 Throw exception when unrecognized URI, bad Metalink or bad .torrent
file are given in command-line and exits with status non-zero.
2010-12-04 17:19:31 +09:00
Tatsuhiro Tsujikawa c81dcd80ea Removed 3rd argument auxUris of createBtMagnetRequestGroup(). 2010-12-04 16:47:09 +09:00
Tatsuhiro Tsujikawa f9a6697352 Fixed compile error without ssl library. 2010-12-04 00:37:42 +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 7ac1f17d56 Added missing error_code.h to Makefile.am 2010-12-01 23:06:39 +09:00
Tatsuhiro Tsujikawa f0f4f8f703 Added more error code values.
I have not set error code for all exception invocation.
In this change, I set error code where error likely occurs.
2010-12-01 21:26:58 +09:00
Tatsuhiro Tsujikawa 6bc215fcec Add groupToAdd to requestGroups_ even if exception is thrown in
createInitialCommand().

This makes groupToAdd be processed by removeStoppedGroup() and
--on-download-error hook is properly triggered.  Now
--on-download-start is also triggered for groupToAdd even if exception
is thrown in createInitialCommand().
2010-11-29 21:06:39 +09:00
Tatsuhiro Tsujikawa 378ba26ed3 Updated doc 2010-11-29 21:06:00 +09:00
Tatsuhiro Tsujikawa a0139e3e08 Call RequestGroup::setLastError in
PeerInteractionCommand::onFailure().

Added const Exception& argument to virtual
AbstractCommand::onFailure().
2010-11-29 01:37:32 +09:00
Tatsuhiro Tsujikawa d5b6ec8621 Call RequestGroup::setLastError when exception is caught while
creating initial commands.
2010-11-29 01:32:25 +09:00
Tatsuhiro Tsujikawa f5a9448cf1 Moved setLastError call before if(req_) {... 2010-11-29 01:30:24 +09:00
Tatsuhiro Tsujikawa ce6eb592da Added Exception ctor which takes both errNum and errorCode.
Also added DlAbortEx ctor which has same signature with new Exception
dtor.  Added DL_ABORT_EX3 macro to use added ctor.
2010-11-28 22:30:06 +09:00
Tatsuhiro Tsujikawa e8f3592314 Removed include of cerrno from Exception.h 2010-11-28 21:42:03 +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 45fde1adaf Cleaned up Exception constructors.
Removed Exception(const char*, int, const Exception&) ctor.  Also
removed FatalException() copy ctor.
2010-11-28 21:03:11 +09:00
Tatsuhiro Tsujikawa 50122f0ab3 Renamed Exception::errno_ as Exception::errNum_. 2010-11-28 19:06:56 +09:00
Tatsuhiro Tsujikawa ecbc05012c Added additional error_code::Values(9 through 14). 2010-11-28 17:29:32 +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 f4e008f886 Moved include of gettext.h to the outside of #ifdef ENABLE_NLS since
gettext.h has it inside itself.
2010-11-28 00:05:56 +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 ba026adb5e 2010-11-26 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
For MINGW32 build, percent-encode non-ASCII characters in
	filename.
	* src/util.cc
2010-11-26 13:07:28 +00:00
Tatsuhiro Tsujikawa 721f53ea97 2010-11-26 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Include last '/' to directory name to create. This will avoid to
	create directory 'C:' in Windows.
	* src/File.cc
2010-11-26 12:34:02 +00: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 94c4a71d63 2010-11-25 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Removed MultiDiskAdaptor::mkdir() because directory structure is
	created at AbstractDiskWriter::createFile().
	* src/MultiDiskAdaptor.cc
	* src/MultiDiskAdaptor.h
2010-11-25 12:38:57 +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 3a897a4f32 2010-11-24 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added white space after ',' when enumerating valid parameters.
	* src/OptionHandlerImpl.cc
2010-11-24 11:42:08 +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 b8055f259b 2010-11-23 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Made --allow-overwrite, --allow-piece-length-change,
	--realtime-chunk-checksum and --bt-require-crypto take optional
	argument. Fixed usage doc for --metalink-enable-unique-protocol.
	* doc/aria2c.1.txt
	* src/OptionHandlerFactory.cc
	* src/usage_text.h
2010-11-23 14:11:45 +00:00
Tatsuhiro Tsujikawa b2fbe2c896 2010-11-23 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Made --continue, --daemon, --no-conf, --no-netrc and --show-files
	option take optional argument.
	* doc/aria2c.1.txt
	* src/OptionHandlerFactory.cc
	* src/usage_text.h
2010-11-23 13:59:03 +00:00
Tatsuhiro Tsujikawa 752234ae66 2010-11-20 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added BtSeederStateChoke::PeerEntry::swap(). Also added
	non-member swap for it, which is friend function for
	BtSeederStateChoke because PeerEntry is private.
	* src/BtSeederStateChoke.cc
	* src/BtSeederStateChoke.h
2010-11-20 15:01:24 +00:00
Tatsuhiro Tsujikawa 8f46dbc0ab 2010-11-20 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added BtLeecherStateChoke::PeerEntry::swap(). Also added
	non-member swap for it, which is friend function for
	BtLeecherStateChoke because PeerEntry is private.
	* src/BtLeecherStateChoke.cc
	* src/BtLeecherStateChoke.h
2010-11-20 14:52:52 +00:00
Tatsuhiro Tsujikawa 4ed364d772 2010-11-20 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added CookieStorage::DomainEntry::swap(). Also added non-member
	swap for it.
	* src/CookieStorage.cc
	* src/CookieStorage.h
2010-11-20 14:05:58 +00:00
Tatsuhiro Tsujikawa c552842505 2010-11-20 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Made LogFactory::logger_ as SharedHandle<Logger> to make dtor of
	Logger called at the program exit.  Rewritten A2_LOG_* macro and
	moved them to LogFactory.h
	* src/LogFactory.cc
	* src/LogFactory.h
	* src/Logger.cc
	* src/Logger.h
2010-11-20 12:33:12 +00:00
Tatsuhiro Tsujikawa 9a67929d8c 2010-11-20 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Renamed cuid as cuid_t in DefaultBtMessageDispatcher.
	* src/DefaultBtMessageDispatcher.cc
	* src/DefaultBtMessageDispatcher.h
2010-11-20 12:14:23 +00:00
Tatsuhiro Tsujikawa 03417e94b4 2010-11-20 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Use format specifier %lld for cuid_t. Defined cuid_t as long long
	int instead of int64_t, since g++ complains int64_t is not
	suitable for %lld.
2010-11-20 12:12:06 +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 580098eb49 2010-11-20 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Rewritten Logger interface. Logger now writes source file name and
	line number in log file.
2010-11-20 08:21:36 +00:00
Tatsuhiro Tsujikawa 3940da7562 2010-11-18 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Made DHTBucketTreeNode non-copyable.
	* src/DHTBucketTree.h
2010-11-18 12:13:59 +00:00
Tatsuhiro Tsujikawa 698876e2eb 2010-11-18 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Enter 'end game' mode from the beginning when getting torrent
	metadata for quick data retrieval.
	* src/HandshakeExtensionMessage.cc
2010-11-18 12:10:15 +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 8a1578d741 2010-11-15 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added non-member swap() for SharedHandle.
	* src/SharedHandle.h
2010-11-15 13:45:13 +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 6a1fe66975 2010-11-15 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Use SharedHandle::swap() in some places.
	* src/RequestGroup.cc
2010-11-15 12:02:54 +00:00
Tatsuhiro Tsujikawa de8598b63a 2010-11-15 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added SharedHandle::swap
	* src/SharedHandle.h
2010-11-15 12:02:10 +00:00
Tatsuhiro Tsujikawa e16844cc8f 2010-11-14 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Use --max-connection-per-server option value for Metalink.
	* src/Metalink2RequestGroup.cc
2010-11-14 08:36:41 +00:00
Tatsuhiro Tsujikawa ba540085a6 2010-11-14 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed compile error on opensolaris
	* src/util.cc
2010-11-14 08:19:53 +00:00
Tatsuhiro Tsujikawa af33f67fee 2010-11-14 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Don't catch Exception.
	* src/RealtimeCommand.cc
2010-11-14 08:13:59 +00:00
Tatsuhiro Tsujikawa 1d77c67f1b 2010-11-14 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Removed unused includes.
2010-11-14 08:12:38 +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 f6f5a7e5ee 2010-11-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed memory leak
	* src/ExpatMetalinkProcessor.cc
2010-11-11 13:38:34 +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 bcf4593bda 2010-11-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Create SharedHandle outside of function call to avoid unexpected
	memory leak.
	* src/AnnounceList.cc
	* src/FtpNegotiationCommand.cc
	* src/HttpResponseCommand.cc
	* src/RequestGroup.cc
	* src/RequestGroupMan.cc
	* src/UTMetadataPostDownloadHandler.cc
	* src/download_helper.cc
2010-11-11 05:12:37 +00:00
Tatsuhiro Tsujikawa 1946b3341f 2010-11-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added sha-224, sha-384, sha-512 hash function support.
	* m4/openssl.m4
	* src/MessageDigest.cc
	* src/LibgcryptMessageDigestImpl.cc
	* src/LibsslMessageDigestImpl.cc
2010-11-11 03:23:08 +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 513e8a7917 2010-11-10 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Print IP protocol version when setting up XML-RPC server failed.
	* src/HttpListenCommand.cc
2010-11-09 15:22:50 +00:00
Tatsuhiro Tsujikawa f1af13567f 2010-11-10 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Retry open(2) and fallocate(2) when they are interrupted by
	signal.
	* src/AbstractDiskWriter.cc
2010-11-09 15:18:25 +00:00
Tatsuhiro Tsujikawa 228b4c50d7 2010-11-09 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Capture errno right after system/library call to avoid it to get
	overwritten. Use util::safeStrerror instead of strerror directly
	because strerror might return NULL. We don't check errno for
	std::fstream anymore.
	* src/AbstractDiskWriter.cc
	* src/CookieStorage.cc
	* src/DHTAutoSaveCommand.cc
	* src/DHTRoutingTableDeserializer.cc
	* src/DHTRoutingTableSerializer.cc
	* src/DefaultBtProgressInfoFile.cc
	* src/EpollEventPoll.cc
	* src/IteratableChunkChecksumValidator.cc
	* src/KqueueEventPoll.cc
	* src/Logger.cc
	* src/MessageDigestHelper.cc
	* src/PortEventPoll.cc
	* src/SelectEventPoll.cc
	* src/SocketCore.cc
	* src/message.h
	* src/util.cc
	* src/util.h
2010-11-09 14:43:47 +00:00
Tatsuhiro Tsujikawa 02f725cab5 2010-11-07 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Use const reference
	* src/UnionSeedCriteria.h
2010-11-06 15:33:19 +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 6e88cae02b 2010-10-31 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed the bug that downloading > 4GB file fails on 32bit systems.
	* src/HttpRequest.cc
	* src/HttpRequestCommand.cc
2010-10-31 04:36:38 +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 6ecfa4aad1 2010-10-30 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added '// namespace' after end of unnamed namespace.
	* src/AbstractCommand.cc
	* src/AnnounceList.cc
	* src/BtSeederStateChoke.cc
	* src/ConsoleStatCalc.cc
	* src/CookieStorage.cc
	* src/DHTBucket.cc
	* src/DHTPeerAnnounceEntry.cc
	* src/DHTPeerAnnounceStorage.cc
	* src/DHTTaskQueueImpl.cc
	* src/DefaultBtMessageDispatcher.cc
	* src/DefaultBtRequestFactory.cc
	* src/DefaultPeerStorage.cc
	* src/DefaultPieceStorage.cc
	* src/ExpatMetalinkProcessor.cc
	* src/ExpatXmlRpcRequestProcessor.cc
	* src/FeedbackURISelector.cc
	* src/FileEntry.cc
	* src/GZipEncoder.cc
	* src/Metalink2RequestGroup.cc
	* src/MetalinkEntry.cc
	* src/MetalinkParserStateV3Impl.cc
	* src/MetalinkParserStateV4Impl.cc
	* src/Metalinker.cc
	* src/MultiDiskAdaptor.cc
	* src/Netrc.cc
	* src/NsCookieParser.cc
	* src/OptionParser.cc
	* src/PieceStatMan.cc
	* src/RarestPieceSelector.cc
	* src/RequestGroupMan.cc
	* src/SegmentMan.cc
	* src/ServerStatMan.cc
	* src/SocketCore.cc
	* src/XML2SAXMetalinkProcessor.cc
	* src/Xml2XmlRpcRequestProcessor.cc
	* src/XmlRpcMethodImpl.cc
	* src/cookie_helper.cc
	* src/download_helper.cc
	* src/messageDigest.cc
	* src/util.cc
2010-10-30 14:53:40 +00:00
Tatsuhiro Tsujikawa e5d1b812c8 2010-10-30 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Removed unnecessary unnamed namespace
	* src/a2functional.h
2010-10-30 12:31:53 +00:00
Tatsuhiro Tsujikawa df5db9b84f 2010-10-30 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Tagged -x and -k option as #basic
	* src/OptionHandlerFactory.cc
2010-10-30 08:26:35 +00:00
Tatsuhiro Tsujikawa e032014466 2010-10-29 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed compiler warning with --disable-bittorrent and
	--disable-metalink.
	* src/download_helper.cc
2010-10-28 15:04:57 +00:00
Tatsuhiro Tsujikawa b7df39b7ae 2010-10-28 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed compiler warning about printf format.
	* src/AdaptiveURISelector.cc
	* src/BtPieceMessage.cc
	* src/DHTAbstractNodeLookupTask.h
	* src/DHTMessageFactoryImpl.cc
	* src/DHTPeerLookupTask.cc
	* src/DHTReplaceNodeTask.cc
	* src/DefaultBtAnnounce.cc
	* src/DefaultBtInteractive.cc
	* src/DefaultBtMessageDispatcher.cc
	* src/DefaultBtProgressInfoFile.cc
	* src/DefaultBtRequestFactory.cc
	* src/DefaultExtensionMessageFactory.cc
	* src/DefaultPieceStorage.cc
	* src/DownloadCommand.cc
	* src/FileAllocationCommand.cc
	* src/FileEntry.cc
	* src/HandshakeExtensionMessage.cc
	* src/IteratableChunkChecksumValidator.cc
	* src/LibgcryptDHKeyExchange.h
	* src/LibsslDHKeyExchange.h
	* src/LpdDispatchMessageCommand.cc
	* src/MSEHandshake.cc
	* src/MessageDigestHelper.cc
	* src/MultiDiskAdaptor.cc
	* src/PeerConnection.cc
	* src/SegmentMan.cc
	* src/TimedHaltCommand.cc
	* src/UTMetadataRequestExtensionMessage.cc
	* src/UTPexExtensionMessage.cc
	* src/bencode2.cc
	* src/bittorrent_helper.cc
	* src/message.h
2010-10-28 14:19:29 +00:00
Tatsuhiro Tsujikawa 17a0a5baad 2010-10-27 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Removed unused variable r.
	* src/StringFormat.cc
2010-10-27 14:58:47 +00:00
Tatsuhiro Tsujikawa 9ff8e55d04 2010-10-27 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added printf format check attribute.
	* src/Logger.h
	* src/StringFormat.h
2010-10-27 14:57:46 +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 5eec87df03 2010-10-26 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed improper use of vsnprintf
	* src/StringFormat.cc
2010-10-26 11:46:19 +00:00
Tatsuhiro Tsujikawa 831bac1471 2010-10-23 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed the bug that dht.dat file could not be saved. This is
	because a directory denoting temporary file path is wrongly
	created and thus aria2 fails to open the file as regular file.
	* src/DHTAutoSaveCommand.cc
2010-10-23 13:43:32 +00:00
Tatsuhiro Tsujikawa 51308002d3 2010-10-19 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Don't reuse socket which is readable because we assume that if
	socket is readable it means peer shutdowns connection and the
	socket will receive EOF. Added default timeout value to
	DownloadEngine::poolSocket().
	* src/DownloadEngine.cc
	* src/DownloadEngine.h
2010-10-19 14:02:47 +00:00
Tatsuhiro Tsujikawa 6b74a27586 2010-10-19 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed the bug that file allocation is enabled in HTTP even if
	--file-allocation=none is specified.
	* src/HttpResponseCommand.cc
2010-10-19 13:46:51 +00:00
Tatsuhiro Tsujikawa 942f4c00a9 2010-10-12 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Rewritten AbstractDiskWriter::openFile() without File::exists().
	* src/AbstractCommand.cc
2010-10-11 15:15:13 +00:00
Tatsuhiro Tsujikawa 4ddc6eac58 2010-10-12 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added errno member variable to Exception.
	* src/DlAbortEx.cc
	* src/DlAbortEx.h
	* src/Exception.cc
	* src/Exception.h
	* src/RecoverableException.cc
	* src/RecoverableException.h
2010-10-11 15:13:53 +00:00
Tatsuhiro Tsujikawa 8bfe35d3f2 2010-10-12 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Simplified directory creation.
	* src/DHTAutoSaveCommand.cc
2010-10-11 15:10:28 +00:00
Tatsuhiro Tsujikawa b3036d5840 2010-10-12 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Skip ";" after name value pair.
	* src/cookie_helper.cc
2010-10-11 15:09:06 +00:00
Tatsuhiro Tsujikawa b56a0a6d79 2010-10-12 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Rewritten util::mkdirs()
	* src/util.cc
2010-10-11 15:08:09 +00:00
Tatsuhiro Tsujikawa 1a13d35406 2010-10-12 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Rewritten File::mkdirs()
	* src/File.cc
2010-10-11 15:07:26 +00:00
Tatsuhiro Tsujikawa 119b9a8448 2010-10-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Use RFC1123 date format in debug log of MDTM response and
	last-modified time and creation date of .torrent file printed
	using -S.
	* src/FtpNegotiationCommand.cc
	* src/RequestGroup.cc
	* src/bittorrent_helper.cc
2010-10-11 12:40:20 +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 bcddb4cfa3 2010-10-10 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Remove expired cookies first when cookies_ is full.
	* src/CookieStorage.cc
2010-10-10 09:22:04 +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
Tatsuhiro Tsujikawa 8f173868dc 2010-10-10 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Code cleanup
	* src/cookie_helper.cc
2010-10-10 03:43:20 +00:00
Tatsuhiro Tsujikawa 1875d7382f 2010-10-10 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Replaced util::split(a,b,c) and util::split(a,b) with
	util::divide()
	* src/ExpatMetalinkProcessor.cc
	* src/FtpConnection.cc
	* src/HttpHeader.cc
	* src/HttpResponse.cc
	* src/HttpServer.cc
	* src/OptionParser.cc
	* src/ParameterizedStringParser.cc
	* src/ServerStatMan.cc
	* src/magnet.cc
	* src/util.cc
	* src/util.h
	* test/UtilTest.cc
2010-10-10 03:39:00 +00:00
Tatsuhiro Tsujikawa 983b6006fd 2010-10-10 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Append 'u' to hex mask.
	* src/Base64.cc
	* src/BitfieldMan.cc
	* src/BtHandshakeMessage.cc
	* src/BtHandshakeMessage.h
	* src/DHTBucket.cc
	* src/DHTRoutingTableDeserializer.cc
	* src/DHTRoutingTableSerializer.cc
	* src/DefaultBtProgressInfoFile.cc
	* src/MSEHandshake.h
	* src/MultiUrlRequestInfo.cc
	* src/Platform.cc
	* src/SpeedCalc.cc
	* src/UTPexExtensionMessage.cc
	* src/a2netcompat.h
	* src/base32.cc
	* src/bitfield.h
	* src/bittorrent_helper.cc
	* src/cookie_helper.cc
	* src/util.h
2010-10-10 03:08:30 +00:00
Tatsuhiro Tsujikawa 8e059b66fa 2010-10-10 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added util::lowercase() and util::uppercase().
	* src/cookie_helper.cc
	* src/util.cc
	* src/util.h
	* test/UtilTest.cc
2010-10-10 02:51:38 +00:00
Tatsuhiro Tsujikawa 1505671e7b 2010-10-10 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Use util::strip() instead of util::trim()
	* src/ExpatXmlRpcRequestProcessor.cc
	* src/FeatureConfig.cc
	* src/HttpHeader.cc
	* src/MetalinkParserStateV3Impl.cc
	* src/OptionHandlerImpl.h
	* src/ServerStatMan.cc
	* src/UriListParser.cc
	* src/Xml2XmlRpcRequestProcessor.cc
	* src/bittorrent_helper.cc
	* src/cookie_helper.cc
	* src/messageDigest.cc
	* src/util.cc
	* src/util.h
	* test/FeatureConfigTest.cc
	* test/HttpRequestTest.cc
	* test/UriListParserTest.cc
	* test/UtilTest.cc
2010-10-09 16:49:02 +00:00
Tatsuhiro Tsujikawa dbea00fa9d 2010-10-10 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added util::strip()
	* src/util.cc
	* src/util.h
	* test/UtilTest.cc
2010-10-09 16:22:56 +00:00
Tatsuhiro Tsujikawa b8f8a14937 2010-10-09 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Don't append slash in CookieStorage::criteriaFind().  Append file
	part of URI to request-uri in HttpRequest::createRequest().  This
	change reverts the part of the previous change:"The
	request-path must be ends with '/' so that request-path '/foo/'
	path-matches cookie-path '/foo' and '/foo/' in the proposed
	algorithm."
	* src/CookieStorage.cc
	* src/HttpRequest.cc
2010-10-09 14:38:47 +00:00
Tatsuhiro Tsujikawa 8b17d4b276 2010-10-09 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Rewritten Cookie class and Cookie parser based on
	http://tools.ietf.org/html/draft-ietf-httpstate-cookie-14 with
	some modifications. When parsing cookie date, match time first so
	that it parses asctime() format. The request-path must be ends
	with '/' so that request-path '/foo/' path-matches cookie-path
	'/foo' and '/foo/' in the proposed algorithm.
	* src/Cookie.cc
	* src/Cookie.h
	* src/CookieParser.cc: Removed
	* src/CookieParser.h: Removed
	* src/CookieStorage.cc
	* src/CookieStorage.h
	* src/HttpResponse.cc
	* src/Makefile.am
	* src/Makefile.in
	* src/MultiUrlRequestInfo.cc
	* src/NsCookieParser.cc
	* src/NsCookieParser.h
	* src/Sqlite3CookieParser.cc
	* src/Sqlite3CookieParser.h
	* src/a2functional.h
	* src/cookie_helper.cc
	* src/cookie_helper.h
	* src/util.cc
	* src/util.h
	* test/CookieBoxFactoryTest.cc: Removed
	* test/CookieHelperTest.cc
	* test/CookieParserTest.cc: Removed
	* test/CookieStorageTest.cc
	* test/CookieTest.cc
	* test/HttpRequestTest.cc
	* test/Makefile.am
	* test/Makefile.in
	* test/NsCookieParserTest.cc
	* test/Sqlite3CookieParserTest.cc
	* test/TestUtil.cc
	* test/TestUtil.h
	* test/a2functionalTest.cc
	* test/chromium_cookies.sqlite
	* test/cookies.sqlite
	* test/nscookietest.txt
2010-10-09 14:22:49 +00:00
Tatsuhiro Tsujikawa 9b1280f7a3 2010-10-05 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Supported ANSI C's asctime() format in Time::parseHTTPDate().
	Added Time::parseAsctime(). Changed order of application of parse
	functions. I could not remember why parseRFC850() was tried first.
	* src/TimeA2.cc
	* src/TimeA2.h
	* test/TimeTest.cc
2010-10-04 15:12:27 +00:00
Tatsuhiro Tsujikawa 5db7b123b5 2010-10-04 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Use inet_ntoa if inet_ntop is not available. Since inet_ntoa does
	not handle IPv6 address, IPv6 support is limited in this
	case. Fixed unit test error under mingw32.
	* configure.ac
	* src/AsyncNameResolver.cc
	* src/SocketCore.cc
	* src/bittorrent_helper.cc
	* test/BittorrentHelperTest.cc
	* test/DHTMessageFactoryImplTest.cc
	* test/DHTRoutingTableDeserializerTest.cc
	* test/DHTRoutingTableSerializerTest.cc
	* test/DefaultBtAnnounceTest.cc
	* test/Metalink2RequestGroupTest.cc
	* test/UTPexExtensionMessageTest.cc
2010-10-04 14:33:49 +00:00
Tatsuhiro Tsujikawa 329de2a9b5 2010-10-03 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Reverted the previous change in src/MultiUrlRequestInfo.cc.
	Change log level of warning message about CA certificates to info.
	* src/MultiUrlRequestInfo.cc
2010-10-03 14:13:03 +00:00
Tatsuhiro Tsujikawa be2cd51e1b 2010-10-03 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Removed warning message when CA certificates are not imported.
	--ca-certificate and --check-certificate option were added to the
	error message displayed when certificate verification failed.
	* src/MultiUrlRequestInfo.cc
	* src/message.h
2010-10-03 14:07:57 +00:00
Tatsuhiro Tsujikawa af207e6cd8 2010-10-03 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Print message when performing slow file allocation at first time.
	* src/SingleFileAllocationIterator.cc
	* src/SingleFileAllocationIterator.h
2010-10-03 13:31:58 +00:00
Tatsuhiro Tsujikawa 32d4ffa8ee 2010-10-02 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed compile error on OpenBSD4.7(i386). In openssl.m4, we first
	search libcrypto and then libssl because libssl depends on
	libcrypto on OpenBSD.
	* src/Netrc.cc
	* src/Netrc.h
	* src/Triplet.h
	* src/openssl.m4
2010-10-03 09:19:33 +00:00
Tatsuhiro Tsujikawa 584af68e19 2010-10-02 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Execute 5 DHT tasks concurrently in each task queue.
	* src/DHTTaskExecutor.cc
	* src/DHTTaskExecutor.h
	* src/DHTTaskQueueImpl.cc
	* src/DHTTaskQueueImpl.h
	* src/Makefile.am
	* test/DHTTaskExecutorTest.cc
	* test/Makefile.am
	* test/MockDHTTask.h
2010-10-02 14:38:37 +00:00
Tatsuhiro Tsujikawa 7375a778c4 2010-10-02 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed the bug that FtpFinishDownloadCommand does not handle
	timeout. This means it waits for the remote server to send "226
	Transfer Complete" message *without* its own timeout until the
	remote server shutdowns connection(we can detect EOF in this
	case).
	* src/AbstractCommand.h
	* src/FtpFinishDownloadCommand.cc
2010-10-02 10:12:10 +00:00
Tatsuhiro Tsujikawa 86d4d1963a 2010-10-02 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Code cleanup util::percentEncode()
	* src/util.cc
2010-10-02 08:31:28 +00:00
Tatsuhiro Tsujikawa 29d40a666f 2010-10-02 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Made string literal static std::string in
	util::detectDirTraversal().
	* src/util.cc
2010-10-02 08:29:15 +00:00
Tatsuhiro Tsujikawa d5e0046f29 2010-10-02 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Rewritten util::escapePath(). Now it does not replace bad chars:it
	performs percent-encode against them.  util::fixTaintedBasename()
	now replaces "/" with "%2F".  Added 0x7f as bad chars in
	util::detectDirTraversal().
	* src/util.cc
	* test/UtilTest.cc
2010-10-02 08:20:10 +00:00
Tatsuhiro Tsujikawa d956ea0b70 2010-10-02 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Non-UTF8 filenames are now percent-encoded.  For example, filename
	for http://example.org/%90%A2%8AE will be %90%A2%8AE because it is
	Shift_JIS. The comments and name in .torrent file in XML-RPC
	response are percent-encoded if they are not UTF-8.
	* src/FtpNegotiationCommand.cc
	* src/HttpRequestCommand.cc
	* src/HttpResponseCommand.cc
	* src/XmlRpcMethodImpl.cc
	* src/bittorrent_helper.cc
	* src/util.cc
	* src/util.h
	* test/BittorrentHelperTest.cc
	* test/UtilTest.cc
2010-10-02 07:54:43 +00:00
Tatsuhiro Tsujikawa 6c348f0493 2010-09-26 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Renamed TripletGet as TupleGet. Renamed TripletNthType as
	TupleNthType. Renamed Triplet2Pair as Tuple2Pair.
	* src/RequestGroupMan.cc
	* src/Triplet.h
	* test/TripletTest.cc
2010-09-26 07:23:00 +00:00
Tatsuhiro Tsujikawa 6a07182b0d 2010-09-26 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Use class instead of typename for Triplet template parameter.
	* src/Triplet.h
2010-09-26 06:56:26 +00:00
Tatsuhiro Tsujikawa 41a096035c 2010-09-26 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Rewritten TripletGet.
	* src/Triplet.h
2010-09-26 06:54:25 +00:00
Tatsuhiro Tsujikawa e07f7207fa 2010-09-26 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Rewritten TripletNthType.
	* src/Triplet.h
	* test/TripletTest.cc
2010-09-26 06:46:12 +00:00
Tatsuhiro Tsujikawa aabd7b75f9 2010-09-26 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Sort usedHosts by least used and faster download speed.
	* src/Makefile.am
	* src/RequestGroupMan.cc
	* src/Triplet.h
	* test/Makefile.am
	* test/TripletTest.cc
2010-09-26 05:47:12 +00:00
Tatsuhiro Tsujikawa ac7d8dc483 2010-09-23 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Made small optimization.
	* src/DownloadCommand.cc
2010-09-23 11:49:37 +00:00
Tatsuhiro Tsujikawa aea9199b40 2010-09-23 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Reset download start time of PeerStat because it is started before
	file allocation begins. Without reset, we have incorrect download
	time and aria2 wrongly determines that download speed is too low
	if --lowest-speed-limit is used.
	* src/StreamFileAllocationEntry.cc
2010-09-23 10:10:16 +00:00
Tatsuhiro Tsujikawa c56a9bc669 2010-09-19 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added keys parameter to aria2.tellStatus, aria2.tellActive,
	aria2.tellWaiting and aria2.tellStopped XML-RPC method.  'keys' is
	array of string. If it is specified, the response contains only
	keys in 'keys' array. If 'keys' is empty or not specified, the
	response contains all keys.  This is useful when you just want
	specific keys and avoid unnecessary transfers. For example,
	*aria2.tellStatus*("1", ["gid", "status"]) returns 'gid' and
	'status' key. Made get*Param() functions XmlRpcRequest's
	methods and changed portions of the code that were affected by
	this change.
	* doc/aria2c.1.txt
	* src/Makefile.am
	* src/XmlRpcMethodImpl.cc
	* src/XmlRpcMethodImpl.h
	* src/XmlRpcRequest.cc
	* src/XmlRpcRequest.h
	* test/XmlRpcMethodTest.cc
2010-09-19 09:49:11 +00:00
Tatsuhiro Tsujikawa 50a89e2592 2010-09-15 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Print a message in console when download is not complete.
	* src/RequestGroupMan.cc
2010-09-15 12:37:02 +00:00
Tatsuhiro Tsujikawa 1d2080361d 2010-09-15 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Don't set error in ServerStat just because resource is not
	there. We can still use the server for other resources.
	* src/AbstractCommand.cc
2010-09-15 12:22:31 +00:00
Tatsuhiro Tsujikawa 2c3411f709 2010-09-15 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Disabled --dry-run in multi-file download for now.
	* src/RequestGroup.cc
2010-09-15 12:15:54 +00:00
Tatsuhiro Tsujikawa a27968beda 2010-09-15 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed the bug that a file gets overwritten if -V is given and no
	hash is provided. Fixed the bug that --dry-run leads download
	error. Added RequestGroup::createCheckIntegrityEntry() which
	correctly creates CheckIntegrityEntry objects and open files based
	on -V option and the existence of control file.
	* src/AbstractCommand.cc
	* src/AbstractCommand.h
	* src/ChecksumCheckIntegrityEntry.cc
	* src/DownloadContext.cc
	* src/DownloadContext.h
	* src/FtpNegotiationCommand.cc
	* src/HttpResponseCommand.cc
	* src/PieceHashCheckIntegrityEntry.cc
	* src/RequestGroup.cc
	* src/RequestGroup.h
	* src/RequestGroupEntry.cc
	* src/RequestGroupEntry.h
2010-09-15 11:46:25 +00:00
Tatsuhiro Tsujikawa 1906832f43 2010-09-13 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed compile error without zlib
	* src/HttpResponseCommand.cc
2010-09-13 13:31:09 +00:00
Tatsuhiro Tsujikawa 6b6e6bc495 2010-09-13 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Removed ChunkedDecoder. Moved GZipDecodingStreamFilter to under
	'if HAVE_LIBZ'.
	* src/ChunkedDecoder.cc
	* src/ChunkedDecoder.h
	* src/Makefile.am
	* test/ChunkedDecoderTest.cc
	* test/Makefile.am
2010-09-13 12:14:07 +00:00
Tatsuhiro Tsujikawa 7f9e70e5c8 2010-09-13 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Updated doc
	* src/FtpNegotiationCommand.cc
	* src/HttpResponseCommand.cc
	* src/RequestGroup.cc
2010-09-13 11:53:38 +00:00
Tatsuhiro Tsujikawa 97953dd1ae 2010-09-13 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed the bug that error occurs when downloading zero-length file.
	* src/FtpNegotiationCommand.cc
	* src/HttpResponseCommand.cc
2010-09-13 11:47:04 +00:00
Tatsuhiro Tsujikawa 5bf8a53b3f 2010-09-12 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed compile error without OpenSSL/GnuTLS.
	* src/DownloadCommand.cc
2010-09-11 15:57:41 +00:00
Tatsuhiro Tsujikawa 70ebb788b2 2010-09-12 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed compile error without BitTorrent support and OpenSSL/GnuTLS.
	* src/DownloadCommand.cc
	* src/DownloadCommand.h
	* src/RequestGroup.cc
2010-09-11 15:54:53 +00:00
Tatsuhiro Tsujikawa 9eaf3ccb0f 2010-09-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Replaced V_TRUE with A2_V_TRUE. Replaced V_FALSE with A2_V_FALSE.
	* src/AbstractCommand.cc
	* src/HttpResponseCommand.cc
	* src/Option.cc
	* src/OptionHandlerFactory.cc
	* src/OptionHandlerImpl.h
	* src/TrackerWatcherCommand.cc
	* src/download_helper.cc
	* src/main.cc
	* src/prefs.cc
	* src/prefs.h
	* test/AuthConfigFactoryTest.cc
	* test/DefaultBtProgressInfoFileTest.cc
	* test/DownloadHelperTest.cc
	* test/HttpRequestTest.cc
	* test/OptionHandlerTest.cc
	* test/UTMetadataPostDownloadHandlerTest.cc
	* test/XmlRpcMethodTest.cc
2010-09-11 12:48:03 +00:00
Tatsuhiro Tsujikawa f82ffef460 2010-09-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added short option -k for --min-split-size option and -x for
	--max-connection-per-server option. Raised maximum value of
	--max-connection-per-server up to 16.
	* src/OptionHandlerFactory.cc
	* src/usage_text.h
2010-09-11 12:15:41 +00:00
Tatsuhiro Tsujikawa 80edde0205 2010-09-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Use uri::parse instead of Request::setUri() where just URI parser
	is needed.
	* src/AbstractCommand.cc
	* src/AdaptiveURISelector.cc
	* src/DefaultBtAnnounce.cc
	* src/FeedbackURISelector.cc
	* src/FileEntry.cc
	* src/HttpResponseCommand.cc
	* src/ProtocolDetector.cc
	* src/Request.cc
	* src/RequestGroupMan.cc
2010-09-11 12:09:19 +00:00
Tatsuhiro Tsujikawa ec3bd81486 2010-09-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Moved URI parser code to uri.h, uri.cc to provide fast URI parser
	without Request object initialization.
	* src/Makefile.am
	* src/Request.cc
	* src/uri.cc
	* src/uri.h
	* test/Makefile.am
	* test/RequestTest.cc
	* test/UriTest.cc
2010-09-11 09:11:57 +00:00
Tatsuhiro Tsujikawa cb796432ec 2010-09-10 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Store last error of removed download result so that it can be used
	as exit status.
	* src/RequestGroupMan.cc
2010-09-10 15:03:40 +00:00
Tatsuhiro Tsujikawa f26685ded1 2010-09-10 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added --max-download-result=NUM option. This option sets maximum
	number of download result kept in memory. The download results are
	completed/error/ removed downloads. The download results are
	stored in FIFO queue and it can store at most NUM download
	results. When queue is full and new download result is created,
	oldest download result is removed from the front of the queue and
	new one is pushed to the back. Setting big number in this option
	may result high memory consumption after thousands of
	downloads. Specifying 0 means no download result is kept.  Default
	value is 1000.
	* src/OptionHandlerFactory.cc
	* src/RequestGroupMan.cc
	* src/RequestGroupMan.h
	* src/prefs.cc
	* src/prefs.h
	* src/usage_text.h
2010-09-10 14:13:50 +00:00
Tatsuhiro Tsujikawa 32e3ebf112 2010-09-10 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Check hash(hash for entire file, not piece hash) if
	--check-integrity option is given and file is
	downloaded(determined by file length). If it fails, re-download
	file.
	* src/AbstractCommand.cc
	* src/ChecksumCheckIntegrityEntry.cc
	* src/ChecksumCheckIntegrityEntry.h
	* src/FtpNegotiationCommand.cc
	* src/HttpResponseCommand.cc
	* src/RequestGroup.cc
2010-09-10 11:52:16 +00:00
Tatsuhiro Tsujikawa 6e7dd1650e 2010-09-10 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Make finished() return true only when offset == totalLength.
	* src/AdaptiveFileAllocationIterator.cc
	* src/SingleFileAllocationIterator.cc
2010-09-10 11:46:43 +00:00
Tatsuhiro Tsujikawa d687886c24 2010-09-09 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Moved connectedHostname, connectedAddr and connectedPort to
	Request object. Mark cached IP address bad on timeout to allow
	aria2 to renew IP address cache.
	* src/AbstractCommand.cc
	* src/AbstractProxyRequestCommand.cc
	* src/AbstractProxyRequestCommand.h
	* src/FtpInitiateConnectionCommand.cc
	* src/FtpNegotiationCommand.cc
	* src/FtpNegotiationCommand.h
	* src/HttpInitiateConnectionCommand.cc
	* src/HttpRequestCommand.cc
	* src/HttpRequestCommand.h
	* src/InitiateConnectionCommand.cc
	* src/InitiateConnectionCommand.h
	* src/Request.cc
	* src/Request.h
2010-09-09 12:00:42 +00:00
Tatsuhiro Tsujikawa 420500f6bf 2010-09-08 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Call RequestGroupMan::fillRequestGroupFromReserver() repeatedly
	while RequestGroupMan::requestQueueCheck() is true.
	* src/FillRequestGroupCommand.cc
2010-09-08 14:42:03 +00:00
Tatsuhiro Tsujikawa c51815dd52 2010-09-08 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Use const ref
	* src/MultiUrlRequestInfo.cc
2010-09-08 14:39:34 +00:00
Tatsuhiro Tsujikawa 32e1aa1b59 2010-09-08 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed the bug that aria2 reports error and exits with non-zero
	status when file is already downloaded.
	* src/FtpNegotiationCommand.cc
	* src/HttpResponseCommand.cc
	* src/RequestGroup.cc
2010-09-08 14:38:32 +00:00
Tatsuhiro Tsujikawa bf9fd473bb 2010-09-08 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Allow '@' in username and password embedded in URI. It should be
	percent-encoded but many people use their mail address as an
	username and forget about PE.
	* src/Request.cc
	* test/RequestTest.cc
2010-09-08 14:35:30 +00:00
Tatsuhiro Tsujikawa f5b3a820ef 2010-09-06 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Parse original URI when removing same host.
	* src/HttpResponseCommand.cc
2010-09-06 14:52:19 +00:00
Tatsuhiro Tsujikawa efbfe4c006 2010-09-06 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Data from remote server in HTTP/FTP download are now written to
	the disk(or memory) through StreamFilter. Decoding chunked and
	gziped streams are done cascading StreamFilter.
	Removed inefficient 1byte read code.
	* src/ChunkedDecodingStreamFilter.cc
	* src/ChunkedDecodingStreamFilter.h
	* src/DownloadCommand.cc
	* src/DownloadCommand.h
	* src/GZipDecodingStreamFilter.cc
	* src/GZipDecodingStreamFilter.h
	* src/HttpConnection.cc
	* src/HttpDownloadCommand.cc
	* src/HttpResponse.cc
	* src/HttpResponse.h
	* src/HttpResponseCommand.cc
	* src/HttpResponseCommand.h
	* src/HttpSkipResponseCommand.cc
	* src/HttpSkipResponseCommand.h
	* src/Makefile.am
	* src/NullSinkStreamFilter.cc
	* src/NullSinkStreamFilter.h
	* src/RequestGroup.cc
	* src/SinkStreamFilter.cc
	* src/SinkStreamFilter.h
	* src/StreamFilter.cc
	* src/StreamFilter.h
	* test/ChunkedDecodingStreamFilterTest.cc
	* test/GZipDecodingStreamFilterTest.cc
	* test/HttpResponseTest.cc
	* test/Makefile.am
	* test/MockSegment.h
2010-09-06 14:29:36 +00:00
Tatsuhiro Tsujikawa 94482144f2 2010-08-31 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Enclosed classes and structs declared in *.cc files unnamed
	namespace. Added static keyword for function template in *.cc
	files(TODO we should use unnamed namespace instead of static).
	* src/AbstractCommand.cc
	* src/AnnounceList.cc
	* src/BtLeecherStateChoke.cc
	* src/BtLeecherStateChoke.h
	* src/BtSeederStateChoke.cc
	* src/BtSeederStateChoke.h
	* src/ConsoleStatCalc.cc
	* src/ContentTypeRequestGroupCriteria.cc
	* src/CookieStorage.cc
	* src/DHTBucket.cc
	* src/DHTPeerAnnounceEntry.cc
	* src/DHTPeerAnnounceStorage.cc
	* src/DefaultBtMessageDispatcher.cc
	* src/DefaultBtRequestFactory.cc
	* src/DefaultPeerStorage.cc
	* src/DefaultPieceStorage.cc
	* src/ExpatMetalinkProcessor.cc
	* src/ExpatXmlRpcRequestProcessor.cc
	* src/FeedbackURISelector.cc
	* src/FileEntry.cc
	* src/Metalink2RequestGroup.cc
	* src/MetalinkEntry.cc
	* src/Metalinker.cc
	* src/MultiDiskAdaptor.cc
	* src/Netrc.cc
	* src/OptionParser.cc
	* src/PieceStatMan.cc
	* src/RarestPieceSelector.cc
	* src/RequestGroupMan.cc
	* src/SegmentMan.cc
	* src/ServerStatMan.cc
	* src/XML2SAXMetalinkProcessor.cc
	* src/Xml2XmlRpcRequestProcessor.cc
	* src/XmlRpcResponse.cc
	* src/a2algo.h
	* src/download_helper.cc
2010-08-31 13:33:05 +00:00
Tatsuhiro Tsujikawa f9d68a4ecf 2010-08-31 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
In .netrc file, if machine name starts ".", aria2 performs domain
	match instead of exact match. This is an extension of aria2.
	* src/Netrc.h
2010-08-31 11:53:48 +00:00
Tatsuhiro Tsujikawa 5cb09dabf5 2010-08-31 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed the bug which prevents HTTP redirection from working when
	downloading multiple files from same host.
	* src/AbstractCommand.cc
	* src/FileEntry.cc
2010-08-31 11:17:38 +00:00
Tatsuhiro Tsujikawa 98c5a86684 2010-08-29 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added a note about the number of connections to help message.
	* src/version_usage.cc
2010-08-29 13:46:21 +00:00
Tatsuhiro Tsujikawa 9d58a5cefb 2010-08-29 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Run PeerLookupTask more frequently when the number of peer is low.
	* src/DHTGetPeersCommand.cc
	* src/DHTGetPeersCommand.h
2010-08-29 12:43:40 +00:00
Tatsuhiro Tsujikawa c0b0e4f761 2010-08-29 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Drop connection when bad ut_metadata is received..
	* src/UTMetadataDataExtensionMessage.cc
2010-08-29 12:40:56 +00:00
Tatsuhiro Tsujikawa 2b93562528 2010-08-29 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Drop connection when BtRuntime::isHalt() is true.
	* src/PeerReceiveHandshakeCommand.cc
2010-08-29 12:39:30 +00:00
Tatsuhiro Tsujikawa 0968d4fedd 2010-08-29 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Removed getMissingFastPiece(piece) and getMissingFastPiece(piece,
	excludedIndexes) from PieceStorage. Done some code cleanup.
	* src/DefaultPieceStorage.h
	* src/PieceStorage.h
	* src/UnknownLengthPieceStorage.cc
	* src/UnknownLengthPieceStorage.h
	* test/MockPieceStorage.h
2010-08-29 09:24:17 +00:00
Tatsuhiro Tsujikawa 4b2d1deff6 2010-08-29 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Pass excludedIndexes when getting metadata piece.
	* src/UTMetadataRequestFactory.cc
	* test/UTMetadataRequestFactoryTest.cc
2010-08-29 09:22:06 +00:00
Tatsuhiro Tsujikawa e997903e5d 2010-08-29 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added a sets of overloaded functions for
	PieceStorage::getMissingPiece() and getMissingFastPiece() to get
	multiple pieces more efficiently.
	* src/DefaultBtInteractive.cc
	* src/DefaultPieceStorage.cc
	* src/DefaultPieceStorage.h
	* src/PieceStorage.h
	* src/UnknownLengthPieceStorage.cc
	* src/UnknownLengthPieceStorage.h
	* test/DefaultPieceStorageTest.cc
	* test/MockPieceStorage.h
2010-08-29 08:53:19 +00:00
Tatsuhiro Tsujikawa b49081340d 2010-08-28 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Changed signature of util::executeHook().
	* src/RequestGroupMan.cc
	* src/util.cc
	* src/util.h
2010-08-28 08:47:21 +00:00
Tatsuhiro Tsujikawa 33da745070 2010-08-27 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added bt-tracker and bt-exclude-tracker to -i list option.
	* doc/aria2c.1.txt
	* doc/xmlrpc/aria2rpc
	* src/download_helper.cc
2010-08-27 11:58:10 +00:00
Tatsuhiro Tsujikawa b9522dea25 2010-08-27 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Don't listen on IPv6 socket for BitTorrent, DHT, XML-RPC if
	--disable-ipv6 is true.
	* src/BtSetup.cc
	* src/DownloadEngineFactory.cc
	* src/RequestGroup.cc
2010-08-27 11:48:09 +00:00
Tatsuhiro Tsujikawa 5bcc0ba60a 2010-08-27 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Removed unused debug log.
	* src/DefaultBtInteractive.cc
2010-08-27 11:46:49 +00:00
Tatsuhiro Tsujikawa 835de071f2 2010-08-26 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Enter end game mode as soon as all pieces are assigned to peer to
	avoid substantial slow down at the very last stage of download.
	* src/DefaultBtInteractive.cc
	* src/DefaultPieceStorage.cc
	* src/DefaultPieceStorage.h
	* src/PieceStorage.h
	* src/UnknownLengthPieceStorage.h
	* test/MockPieceStorage.h
2010-08-26 14:49:40 +00:00
Tatsuhiro Tsujikawa 7633410ebf 2010-08-25 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Set max outstanding request size to 100. Set stepping to 6.
	* src/BtConstants.h
	* src/DefaultBtInteractive.cc
2010-08-25 13:52:37 +00:00
Tatsuhiro Tsujikawa 065cde0aa5 2010-08-25 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Bump up DHT version to 2.
	* src/DHTConstants.h
2010-08-25 12:35:18 +00:00
Tatsuhiro Tsujikawa bfed6e5e31 2010-08-25 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added error message when given address and resolved address do not
	match in SocketCore::bind().
	* src/SocketCore.cc
2010-08-25 12:32:29 +00:00
Tatsuhiro Tsujikawa 26bf5ab5e2 2010-08-24 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added --bt-tracker and --bt-exclude-tracker option.  In
	--bt-tracker option, you can specify comma separated list of
	additional BitTorrent tracker's announce URI. These URIs are not
	affected by --bt-exclude-tracker option because they are added
	after URIs in --bt-exclude-tracker option are removed.  In
	--bt-exclude-tracker option, you can specify comma separated list
	of BitTorrent tracker's announce URI to remove. You can use
	special value '*' which matches all URIs, thus removes all
	announce URIs. When specifying '*' in shell command-line, don't
	forget to escape or quote it.
	* src/BtDependency.cc
	* src/OptionHandlerFactory.cc
	* src/UTMetadataPostDownloadHandler.cc
	* src/bittorrent_helper.cc
	* src/bittorrent_helper.h
	* src/download_helper.cc
	* src/download_helper.h
	* src/prefs.cc
	* src/prefs.h
	* src/usage_text.h
	* test/BittorrentHelperTest.cc
	* test/DownloadHelperTest.cc
2010-08-24 14:21:12 +00:00
Tatsuhiro Tsujikawa a977bffbf5 2010-08-24 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Code cleanup
	* src/DefaultPeerStorage.cc
2010-08-24 11:40:23 +00:00
Tatsuhiro Tsujikawa f5bd49598b 2010-08-22 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Updated usage.
	* src/usage_text.h
2010-08-22 11:34:53 +00:00
Tatsuhiro Tsujikawa 9b9f3a6c63 2010-08-22 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Removed uitos(). Use util::uitos() instead.
	* src/SocketCore.cc
2010-08-22 11:16:08 +00:00
Tatsuhiro Tsujikawa d7902f0ed7 2010-08-21 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Don't try to send empty string.
	* src/SocketBuffer.cc
	* src/SocketBuffer.h
2010-08-21 13:57:57 +00:00
Tatsuhiro Tsujikawa 8958b92d91 2010-08-14 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Listen both IPv4 and IPv6 for BitTorrent protocol.
	* src/BtSetup.cc
	* src/PeerListenCommand.cc
	* src/PeerListenCommand.h
2010-08-14 06:52:35 +00:00
Tatsuhiro Tsujikawa 3d9bae9170 2010-08-14 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added debug log
	* src/DHTPeerLookupTask.cc
2010-08-14 06:50:08 +00:00
Tatsuhiro Tsujikawa 3032d6ed40 2010-08-14 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Initialized cur_ with values_.end()
	* src/Sequence.h
2010-08-14 03:15:13 +00:00
Tatsuhiro Tsujikawa ef393dba74 2010-08-08 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Listen both IPv4 and IPv6 for xml-rpc request.
	* src/DownloadEngineFactory.cc
	* src/HttpListenCommand.cc
	* src/HttpListenCommand.h
2010-08-07 15:04:21 +00:00
Tatsuhiro Tsujikawa 15b29bed15 2010-08-07 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Updated malformed message handling.
	* src/DHTMessageTracker.cc
	* src/DHTMessageTracker.h
2010-08-07 14:46:22 +00:00
Tatsuhiro Tsujikawa d8e83b3f72 2010-08-07 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Evaluate callback is non-null.
	* src/DHTMessageTracker.cc
2010-08-07 14:22:33 +00:00
Tatsuhiro Tsujikawa 26d6692376 2010-08-07 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added IPv6 DHT. Added --dht-entry-porint6, --dht-file-path6,
	--dht-listen-addr6 and --enable-dht6 option.  IPv6 DHT is disabled
	by default. To use IPv6 DHT, you need to use --enable-dht6 and
	specify a global unicast address to --dht-listen-addr6.  IPv6 DHT
	is highly experimental.
	* src/BtSetup.cc
	* src/DHTAutoSaveCommand.cc
	* src/DHTAutoSaveCommand.h
	* src/DHTConnectionImpl.cc
	* src/DHTConnectionImpl.h
	* src/DHTEntryPointNameResolveCommand.cc
	* src/DHTFindNodeReplyMessage.cc
	* src/DHTFindNodeReplyMessage.h
	* src/DHTGetPeersMessage.cc
	* src/DHTGetPeersReplyMessage.cc
	* src/DHTGetPeersReplyMessage.h
	* src/DHTMessageFactory.h
	* src/DHTMessageFactoryImpl.cc
	* src/DHTMessageFactoryImpl.h
	* src/DHTMessageTracker.cc
	* src/DHTRegistry.cc
	* src/DHTRegistry.h
	* src/DHTRoutingTableDeserializer.cc
	* src/DHTRoutingTableDeserializer.h
	* src/DHTRoutingTableSerializer.cc
	* src/DHTRoutingTableSerializer.h
	* src/DHTSetup.cc
	* src/DHTSetup.h
	* src/FtpConnection.cc
	* src/LpdMessageReceiver.cc
	* src/OptionHandlerFactory.cc
	* src/OptionHandlerImpl.h
	* src/PeerInteractionCommand.cc
	* src/RequestGroup.cc
	* src/SocketCore.cc
	* src/SocketCore.h
	* src/bittorrent_helper.cc
	* src/bittorrent_helper.h
	* src/prefs.cc
	* src/prefs.h
	* src/usage_text.h
	* test/DHTConnectionImplTest.cc
	* test/DHTFindNodeReplyMessageTest.cc
	* test/DHTGetPeersMessageTest.cc
	* test/DHTGetPeersReplyMessageTest.cc
	* test/DHTMessageFactoryImplTest.cc
	* test/DHTRoutingTableDeserializerTest.cc
	* test/DHTRoutingTableSerializerTest.cc
	* test/LpdMessageDispatcherTest.cc
	* test/MockDHTMessageFactory.h
2010-08-07 14:15:21 +00:00
Tatsuhiro Tsujikawa be7012272d 2010-08-05 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Removed AI_V4MAPPED from DEFAULT_AI_FLAGS
	* src/a2netcompat.h
2010-08-07 14:10:17 +00:00
Tatsuhiro Tsujikawa c685ea9de9 2010-08-05 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added support for peers6 key in tracker response.  Added added6,
	added6.f and dropped6 in ut_pex.
	* src/BtAnnounce.cc
	* src/BtAnnounce.h
	* src/DefaultBtAnnounce.cc
	* src/UTPexExtensionMessage.cc
	* src/UTPexExtensionMessage.h
	* test/DefaultBtAnnounceTest.cc
	* test/UTPexExtensionMessageTest.cc
2010-08-05 11:54:44 +00:00
Tatsuhiro Tsujikawa cba1283aae 2010-08-05 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added AI_V4MAPPED to DEFAULT_AI_FLAGS
	* src/a2netcompat.h
2010-08-05 11:50:46 +00:00
Tatsuhiro Tsujikawa 785a27f6e8 2010-08-04 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Add only gracefully disconnected peer to ut_pex dropped list.  Add
	incoming dropped list to PeerStorage.
	* src/DefaultBtInteractive.cc
	* src/DefaultPeerStorage.cc
	* src/InitiatorMSEHandshakeCommand.cc
	* src/Peer.cc
	* src/Peer.h
	* src/PeerConnection.cc
	* src/PeerConnection.h
	* src/PeerInteractionCommand.cc
	* src/PeerReceiveHandshakeCommand.cc
	* src/ReceiverMSEHandshakeCommand.cc
	* src/UTPexExtensionMessage.cc
	* test/DefaultPeerStorageTest.cc
	* test/UTPexExtensionMessageTest.cc
2010-08-04 15:00:38 +00:00
Tatsuhiro Tsujikawa dfdf2d8e56 2010-08-04 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Don't use pre-calculate hash value when end-game mode.  Throw
	exception if bad piece is received.
	* src/BtPieceMessage.cc
	* src/DownloadCommand.cc
2010-08-04 14:15:29 +00:00