fix unit test web server for tracker announces

This commit is contained in:
Arvid Norberg
2013-10-07 00:33:55 +00:00
parent c99f0c120a
commit d90f7336b1
3 changed files with 14 additions and 10 deletions

View File

@@ -80,12 +80,14 @@ int test_main()
addp.save_path = "tmp1_tracker";
torrent_handle h = s->add_torrent(addp);
for (int i = 0; i < 100; ++i)
for (int i = 0; i < 50; ++i)
{
print_alerts(*s, "s");
test_sleep(100);
// fprintf(stderr, "udp_announces: %d http_announces: %d\n", int(g_udp_tracker_requests), int(g_http_tracker_requests));
if (g_udp_tracker_requests == prev_udp_announces + 1
&& g_http_tracker_requests == prev_http_announces + 1) break;
&& g_http_tracker_requests == prev_http_announces + 1)
break;
}
// we should have announced to the tracker by now
@@ -145,10 +147,10 @@ int test_main()
addp.save_path = "tmp2_tracker";
h = s->add_torrent(addp);
for (int i = 0; i < 10; ++i)
for (int i = 0; i < 50; ++i)
{
print_alerts(*s, "s");
test_sleep(1000);
test_sleep(100);
if (g_udp_tracker_requests == prev_udp_announces + 1) break;
}