expose seed_mode feature to client_test
This commit is contained in:
parent
601443afd3
commit
9564636fd2
|
@ -649,6 +649,7 @@ std::string bind_to_interface = "";
|
||||||
std::string outgoing_interface = "";
|
std::string outgoing_interface = "";
|
||||||
int poll_interval = 5;
|
int poll_interval = 5;
|
||||||
int max_connections_per_torrent = 50;
|
int max_connections_per_torrent = 50;
|
||||||
|
bool seed_mode = false;
|
||||||
|
|
||||||
bool share_mode = false;
|
bool share_mode = false;
|
||||||
bool disable_storage = false;
|
bool disable_storage = false;
|
||||||
|
@ -684,6 +685,7 @@ void add_torrent(libtorrent::session& ses
|
||||||
printf("%s\n", t->name().c_str());
|
printf("%s\n", t->name().c_str());
|
||||||
|
|
||||||
add_torrent_params p;
|
add_torrent_params p;
|
||||||
|
p.seed_mode = seed_mode;
|
||||||
if (disable_storage) p.storage = disabled_storage_constructor;
|
if (disable_storage) p.storage = disabled_storage_constructor;
|
||||||
p.share_mode = share_mode;
|
p.share_mode = share_mode;
|
||||||
lazy_entry resume_data;
|
lazy_entry resume_data;
|
||||||
|
@ -988,6 +990,8 @@ int main(int argc, char* argv[])
|
||||||
" this is useful for scripting tests\n"
|
" this is useful for scripting tests\n"
|
||||||
" -k enable high performance settings. This overwrites any other\n"
|
" -k enable high performance settings. This overwrites any other\n"
|
||||||
" previous command line options, so be sure to specify this first\n"
|
" previous command line options, so be sure to specify this first\n"
|
||||||
|
" -G Add torrents in seed-mode (i.e. assume all pieces\n"
|
||||||
|
" are present and check hashes on-demand)\n"
|
||||||
"\n BITTORRENT OPTIONS\n"
|
"\n BITTORRENT OPTIONS\n"
|
||||||
" -c <limit> sets the max number of connections\n"
|
" -c <limit> sets the max number of connections\n"
|
||||||
" -T <limit> sets the max number of connections per torrent\n"
|
" -T <limit> sets the max number of connections per torrent\n"
|
||||||
|
@ -1115,6 +1119,7 @@ int main(int argc, char* argv[])
|
||||||
from_hex(argv[i], 40, (char*)&info_hash[0]);
|
from_hex(argv[i], 40, (char*)&info_hash[0]);
|
||||||
|
|
||||||
add_torrent_params p;
|
add_torrent_params p;
|
||||||
|
p.seed_mode = seed_mode;
|
||||||
if (disable_storage) p.storage = disabled_storage_constructor;
|
if (disable_storage) p.storage = disabled_storage_constructor;
|
||||||
p.share_mode = share_mode;
|
p.share_mode = share_mode;
|
||||||
p.tracker_url = argv[i] + 41;
|
p.tracker_url = argv[i] + 41;
|
||||||
|
@ -1150,6 +1155,7 @@ int main(int argc, char* argv[])
|
||||||
break;
|
break;
|
||||||
case 'B': settings.peer_timeout = atoi(arg); break;
|
case 'B': settings.peer_timeout = atoi(arg); break;
|
||||||
case 'n': settings.announce_to_all_tiers = true; --i; break;
|
case 'n': settings.announce_to_all_tiers = true; --i; break;
|
||||||
|
case 'G': seed_mode = true; --i; break;
|
||||||
case 'd': settings.download_rate_limit = atoi(arg) * 1000; break;
|
case 'd': settings.download_rate_limit = atoi(arg) * 1000; break;
|
||||||
case 'u': settings.upload_rate_limit = atoi(arg) * 1000; break;
|
case 'u': settings.upload_rate_limit = atoi(arg) * 1000; break;
|
||||||
case 'S': settings.unchoke_slots_limit = atoi(arg); break;
|
case 'S': settings.unchoke_slots_limit = atoi(arg); break;
|
||||||
|
@ -1337,6 +1343,7 @@ int main(int argc, char* argv[])
|
||||||
|| std::strstr(i->c_str(), "magnet:") == i->c_str())
|
|| std::strstr(i->c_str(), "magnet:") == i->c_str())
|
||||||
{
|
{
|
||||||
add_torrent_params p;
|
add_torrent_params p;
|
||||||
|
p.seed_mode = seed_mode;
|
||||||
if (disable_storage) p.storage = disabled_storage_constructor;
|
if (disable_storage) p.storage = disabled_storage_constructor;
|
||||||
p.share_mode = share_mode;
|
p.share_mode = share_mode;
|
||||||
p.save_path = save_path;
|
p.save_path = save_path;
|
||||||
|
|
Loading…
Reference in New Issue