From 3c1ecc7d308bb6ad98f79a5d0cbd21fede43a4d2 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Thu, 9 Nov 2006 13:51:36 +0000 Subject: [PATCH] 2006-11-09 Tatsuhiro Tsujikawa Introduce new preference PREF_BT_TIMEOUT. This is the timeout value for BitTorrent download. * src/PeerAbstractCommand.cc (PeerAbstractCommand): PREF_TIMEOUT -> PREF_BT_TIMEOUT * src/main.cc: (timeoutSpecified): Removed. (main): Set the initial value of PREF_BT_TIMEOUT to 180. Removed timeoutSpecified. TODO: Add --bt-timeout command line option. * src/TorrentRequestInfo.cc (timeoutSpecified): Removed. (torrentHandler): Removed timeoutSpecified and the change of timeout value. * src/prefs.h (PREF_BT_TIMEOUT): New definition. Delete unused variables. * src/TorrentRequestInfo.cc (requestInfo): Removed. --- ChangeLog | 24 ++++++++++++++++++++++++ TODO | 1 + po/Makefile.in | 2 +- src/PeerAbstractCommand.cc | 2 +- src/TorrentRequestInfo.cc | 5 ----- src/main.cc | 5 +---- src/prefs.h | 2 ++ 7 files changed, 30 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 49d09eaf..1f67cd38 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,27 @@ +2006-11-09 Tatsuhiro Tsujikawa + + Introduce new preference PREF_BT_TIMEOUT. This is the timeout value + for BitTorrent download. + + * src/PeerAbstractCommand.cc + (PeerAbstractCommand): PREF_TIMEOUT -> PREF_BT_TIMEOUT + * src/main.cc: + (timeoutSpecified): Removed. + (main): Set the initial value of PREF_BT_TIMEOUT to 180. + Removed timeoutSpecified. TODO: Add --bt-timeout command line option. + * src/TorrentRequestInfo.cc + (timeoutSpecified): Removed. + (torrentHandler): Removed timeoutSpecified and the change of timeout + value. + * src/prefs.h + (PREF_BT_TIMEOUT): New definition. + + Delete unused variables. + + * src/TorrentRequestInfo.cc + (requestInfo): Removed. + + 2006-11-09 Tatsuhiro Tsujikawa To add Metalink location option: diff --git a/TODO b/TODO index 15ea17e9..2f542923 100644 --- a/TODO +++ b/TODO @@ -18,3 +18,4 @@ * Use SharedHandle where it is useful. * Rewrite Util::countBit * Add Turkish translation. +* Add the message like "you can resume the transfer by invoking aria2 again" when the download stops. diff --git a/po/Makefile.in b/po/Makefile.in index 98697e7b..0c1ef1ac 100644 --- a/po/Makefile.in +++ b/po/Makefile.in @@ -9,7 +9,7 @@ # General Public License and is *not* in the public domain. PACKAGE = aria2c -VERSION = 0.8.1 +VERSION = 0.9.0 SHELL = /bin/sh diff --git a/src/PeerAbstractCommand.cc b/src/PeerAbstractCommand.cc index 37e24c4e..d3853a97 100644 --- a/src/PeerAbstractCommand.cc +++ b/src/PeerAbstractCommand.cc @@ -48,7 +48,7 @@ PeerAbstractCommand::PeerAbstractCommand(int cuid, const PeerHandle& peer, uploadLimitCheck(false), uploadLimit(0), noCheck(false) { setReadCheckSocket(socket); - timeout = e->option->getAsInt(PREF_TIMEOUT); + timeout = e->option->getAsInt(PREF_BT_TIMEOUT); btRuntime->increaseConnections(); } diff --git a/src/TorrentRequestInfo.cc b/src/TorrentRequestInfo.cc index cfb6a909..113bee21 100644 --- a/src/TorrentRequestInfo.cc +++ b/src/TorrentRequestInfo.cc @@ -39,9 +39,7 @@ #include "BtRegistry.h" #include "DefaultBtContext.h" -extern RequestInfo* requestInfo; extern void setSignalHander(int signal, void (*handler)(int), int flags); -extern bool timeoutSpecified; extern volatile sig_atomic_t btHaltRequested; void torrentHandler(int signal) { @@ -56,9 +54,6 @@ RequestInfos TorrentRequestInfo::execute() { showFileEntry(btContext); return RequestInfos(); } - if(!timeoutSpecified) { - op->put(PREF_TIMEOUT, "180"); - } // set max_tries to 1. AnnounceList handles retries. op->put(PREF_MAX_TRIES, "1"); SharedHandle diff --git a/src/main.cc b/src/main.cc index 722adf79..5ecd27c0 100644 --- a/src/main.cc +++ b/src/main.cc @@ -72,8 +72,6 @@ extern int optind, opterr, optopt; using namespace std; -bool timeoutSpecified; - void setSignalHander(int signal, void (*handler)(int), int flags) { struct sigaction sigact; sigact.sa_handler = handler; @@ -288,7 +286,6 @@ int main(int argc, char* argv[]) { bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); #endif // ENABLE_NLS - timeoutSpecified = false; int c; Option* op = new Option(); @@ -318,6 +315,7 @@ int main(int argc, char* argv[]) { op->put(PREF_TIMEOUT, "60"); op->put(PREF_DNS_TIMEOUT, "10"); op->put(PREF_PEER_CONNECTION_TIMEOUT, "60"); + op->put(PREF_BT_TIMEOUT, "180"); op->put(PREF_MIN_SEGMENT_SIZE, "1048576");// 1M op->put(PREF_MAX_TRIES, "5"); op->put(PREF_HTTP_AUTH_SCHEME, V_BASIC); @@ -644,7 +642,6 @@ int main(int argc, char* argv[]) { int timeout = (int)strtol(optarg, NULL, 10); if(1 <= timeout && timeout <= 600) { op->put(PREF_TIMEOUT, Util::itos(timeout)); - timeoutSpecified = true; } else { cerr << _("timeout must be between 1 and 600") << endl; showUsage(); diff --git a/src/prefs.h b/src/prefs.h index b8912e6a..371cbfc9 100644 --- a/src/prefs.h +++ b/src/prefs.h @@ -129,6 +129,8 @@ */ // values: 1*digit #define PREF_PEER_CONNECTION_TIMEOUT "peer_connection_timeout" +// values: 1*digit +#define PREF_BT_TIMEOUT "bt_timeout" // values: true | false #define PREF_SHOW_FILES "show_files" // values: true | false