mirror of https://github.com/aria2/aria2
2008-07-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added --bt-seed option. If --bt-seed=true is given at the command-line, aria2 seeds previously downloaded files without validating piece hashs. * src/HelpItemFactory.cc * src/OptionHandlerFactory.cc * src/RequestGroup.cc * src/option_processing.cc * src/prefs.cc * src/prefs.h * src/usage_text.hpull/1/head
parent
1059b8b951
commit
d8d8a4cff1
12
ChangeLog
12
ChangeLog
|
@ -1,3 +1,15 @@
|
||||||
|
2008-07-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
||||||
|
|
||||||
|
Added --bt-seed option. If --bt-seed=true is given at the command-line,
|
||||||
|
aria2 seeds previously downloaded files without validating piece hashs.
|
||||||
|
* src/HelpItemFactory.cc
|
||||||
|
* src/OptionHandlerFactory.cc
|
||||||
|
* src/RequestGroup.cc
|
||||||
|
* src/option_processing.cc
|
||||||
|
* src/prefs.cc
|
||||||
|
* src/prefs.h
|
||||||
|
* src/usage_text.h
|
||||||
|
|
||||||
2008-07-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
2008-07-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
||||||
|
|
||||||
Updated DESCRIPTION of man page.
|
Updated DESCRIPTION of man page.
|
||||||
|
|
|
@ -390,6 +390,13 @@ TagContainerHandle HelpItemFactory::createHelpItems(const Option* op)
|
||||||
item->addTag(TAG_BITTORRENT);
|
item->addTag(TAG_BITTORRENT);
|
||||||
tc->addItem(item);
|
tc->addItem(item);
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
HelpItemHandle item(new HelpItem(PREF_BT_SEED,
|
||||||
|
TEXT_BT_SEED,
|
||||||
|
op->get(PREF_BT_SEED)));
|
||||||
|
item->addTag(TAG_BITTORRENT);
|
||||||
|
tc->addItem(item);
|
||||||
|
}
|
||||||
#endif // ENABLE_BITTORRENT
|
#endif // ENABLE_BITTORRENT
|
||||||
#ifdef ENABLE_METALINK
|
#ifdef ENABLE_METALINK
|
||||||
{
|
{
|
||||||
|
|
|
@ -142,6 +142,7 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers()
|
||||||
std::deque<std::string>(¶ms[0],
|
std::deque<std::string>(¶ms[0],
|
||||||
¶ms[arrayLength(params)]))));
|
¶ms[arrayLength(params)]))));
|
||||||
}
|
}
|
||||||
|
handlers.push_back(SH(new BooleanOptionHandler(PREF_BT_SEED)));
|
||||||
return handlers;
|
return handlers;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -239,15 +239,19 @@ void RequestGroup::createInitialCommand(std::deque<Command*>& commands,
|
||||||
} else {
|
} else {
|
||||||
if(_pieceStorage->getDiskAdaptor()->fileExists()) {
|
if(_pieceStorage->getDiskAdaptor()->fileExists()) {
|
||||||
if(!_option->getAsBool(PREF_CHECK_INTEGRITY) &&
|
if(!_option->getAsBool(PREF_CHECK_INTEGRITY) &&
|
||||||
!_option->getAsBool(PREF_ALLOW_OVERWRITE)) {
|
!_option->getAsBool(PREF_ALLOW_OVERWRITE) &&
|
||||||
|
!_option->getAsBool(PREF_BT_SEED)) {
|
||||||
// TODO we need this->haltRequested = true?
|
// TODO we need this->haltRequested = true?
|
||||||
throw DownloadFailureException
|
throw DownloadFailureException
|
||||||
(StringFormat(MSG_FILE_ALREADY_EXISTS,
|
(StringFormat
|
||||||
_pieceStorage->getDiskAdaptor()->getFilePath().c_str()
|
(MSG_FILE_ALREADY_EXISTS,
|
||||||
).str());
|
_pieceStorage->getDiskAdaptor()->getFilePath().c_str()).str());
|
||||||
} else {
|
} else {
|
||||||
_pieceStorage->getDiskAdaptor()->openFile();
|
_pieceStorage->getDiskAdaptor()->openFile();
|
||||||
}
|
}
|
||||||
|
if(_option->getAsBool(PREF_BT_SEED)) {
|
||||||
|
_pieceStorage->markAllPiecesDone();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
_pieceStorage->getDiskAdaptor()->openFile();
|
_pieceStorage->getDiskAdaptor()->openFile();
|
||||||
}
|
}
|
||||||
|
@ -269,8 +273,14 @@ void RequestGroup::createInitialCommand(std::deque<Command*>& commands,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
CheckIntegrityEntryHandle entry(new BtCheckIntegrityEntry(this));
|
CheckIntegrityEntryHandle entry(new BtCheckIntegrityEntry(this));
|
||||||
|
// --bt-seed=true is given and download has completed, skip validation for
|
||||||
processCheckIntegrityEntry(commands, entry, e);
|
// piece hashes.
|
||||||
|
if(_option->getAsBool(PREF_BT_SEED) &&
|
||||||
|
_pieceStorage->downloadFinished()) {
|
||||||
|
entry->onDownloadFinished(commands, e);
|
||||||
|
} else {
|
||||||
|
processCheckIntegrityEntry(commands, entry, e);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -145,6 +145,7 @@ Option* createDefaultOption()
|
||||||
op->put(PREF_BT_REQUIRE_CRYPTO, V_FALSE);
|
op->put(PREF_BT_REQUIRE_CRYPTO, V_FALSE);
|
||||||
op->put(PREF_BT_REQUEST_PEER_SPEED_LIMIT, "51200");
|
op->put(PREF_BT_REQUEST_PEER_SPEED_LIMIT, "51200");
|
||||||
op->put(PREF_BT_MAX_OPEN_FILES, "100");
|
op->put(PREF_BT_MAX_OPEN_FILES, "100");
|
||||||
|
op->put(PREF_BT_SEED, V_FALSE);
|
||||||
op->put(PREF_QUIET, V_FALSE);
|
op->put(PREF_QUIET, V_FALSE);
|
||||||
op->put(PREF_STOP, "0");
|
op->put(PREF_STOP, "0");
|
||||||
#ifdef ENABLE_ASYNC_DNS
|
#ifdef ENABLE_ASYNC_DNS
|
||||||
|
@ -255,7 +256,8 @@ Option* option_processing(int argc, char* const argv[])
|
||||||
{ PREF_BT_MIN_CRYPTO_LEVEL.c_str(), required_argument, &lopt, 30 },
|
{ PREF_BT_MIN_CRYPTO_LEVEL.c_str(), required_argument, &lopt, 30 },
|
||||||
{ PREF_BT_REQUIRE_CRYPTO.c_str(), required_argument, &lopt, 31 },
|
{ PREF_BT_REQUIRE_CRYPTO.c_str(), required_argument, &lopt, 31 },
|
||||||
{ PREF_BT_REQUEST_PEER_SPEED_LIMIT.c_str(), required_argument, &lopt, 32 },
|
{ PREF_BT_REQUEST_PEER_SPEED_LIMIT.c_str(), required_argument, &lopt, 32 },
|
||||||
{ PREF_BT_MAX_OPEN_FILES.c_str(), required_argument, &lopt, 33},
|
{ PREF_BT_MAX_OPEN_FILES.c_str(), required_argument, &lopt, 33 },
|
||||||
|
{ PREF_BT_SEED.c_str(), optional_argument, &lopt, 34 },
|
||||||
#endif // ENABLE_BITTORRENT
|
#endif // ENABLE_BITTORRENT
|
||||||
#ifdef ENABLE_METALINK
|
#ifdef ENABLE_METALINK
|
||||||
{ PREF_METALINK_FILE.c_str(), required_argument, NULL, 'M' },
|
{ PREF_METALINK_FILE.c_str(), required_argument, NULL, 'M' },
|
||||||
|
@ -372,6 +374,9 @@ Option* option_processing(int argc, char* const argv[])
|
||||||
case 33:
|
case 33:
|
||||||
cmdstream << PREF_BT_MAX_OPEN_FILES << "=" << optarg << "\n";
|
cmdstream << PREF_BT_MAX_OPEN_FILES << "=" << optarg << "\n";
|
||||||
break;
|
break;
|
||||||
|
case 34:
|
||||||
|
cmdstream << PREF_BT_SEED << "=" << toBoolArg(optarg) << "\n";
|
||||||
|
break;
|
||||||
case 100:
|
case 100:
|
||||||
cmdstream << PREF_METALINK_VERSION << "=" << optarg << "\n";
|
cmdstream << PREF_METALINK_VERSION << "=" << optarg << "\n";
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -251,6 +251,8 @@ const std::string PREF_BT_REQUIRE_CRYPTO("bt-require-crypto");
|
||||||
const std::string PREF_BT_REQUEST_PEER_SPEED_LIMIT("bt-request-peer-speed-limit");
|
const std::string PREF_BT_REQUEST_PEER_SPEED_LIMIT("bt-request-peer-speed-limit");
|
||||||
// values: 1*digit
|
// values: 1*digit
|
||||||
const std::string PREF_BT_MAX_OPEN_FILES("bt-max-open-files");
|
const std::string PREF_BT_MAX_OPEN_FILES("bt-max-open-files");
|
||||||
|
// values: true | false
|
||||||
|
const std::string PREF_BT_SEED("bt-seed");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Metalink related preferences
|
* Metalink related preferences
|
||||||
|
|
|
@ -255,6 +255,8 @@ extern const std::string PREF_BT_REQUIRE_CRYPTO;
|
||||||
extern const std::string PREF_BT_REQUEST_PEER_SPEED_LIMIT;
|
extern const std::string PREF_BT_REQUEST_PEER_SPEED_LIMIT;
|
||||||
// values: 1*digit
|
// values: 1*digit
|
||||||
extern const std::string PREF_BT_MAX_OPEN_FILES;
|
extern const std::string PREF_BT_MAX_OPEN_FILES;
|
||||||
|
// values: true | false
|
||||||
|
extern const std::string PREF_BT_SEED;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Metalink related preferences
|
* Metalink related preferences
|
||||||
|
|
|
@ -284,6 +284,9 @@ _(" --bt-request-peer-speed-limit=SPEED In BitTorrent downloads, if the download
|
||||||
#define TEXT_BT_MAX_OPEN_FILES \
|
#define TEXT_BT_MAX_OPEN_FILES \
|
||||||
_(" --bt-max-open-files=NUM Specify maximum number of files to open in each\n"\
|
_(" --bt-max-open-files=NUM Specify maximum number of files to open in each\n"\
|
||||||
" BitTorrent download.")
|
" BitTorrent download.")
|
||||||
|
#define TEXT_BT_SEED \
|
||||||
|
_(" --bt-seed[=true|false] Seed previously downloaded files without\n"\
|
||||||
|
" validating piece hashes.")
|
||||||
#define TEXT_METALINK_FILE \
|
#define TEXT_METALINK_FILE \
|
||||||
_(" -M, --metalink-file=METALINK_FILE The file path to the .metalink file.")
|
_(" -M, --metalink-file=METALINK_FILE The file path to the .metalink file.")
|
||||||
#define TEXT_METALINK_SERVERS \
|
#define TEXT_METALINK_SERVERS \
|
||||||
|
|
Loading…
Reference in New Issue