randomize proxy port to improve chances of unit tests passing

This commit is contained in:
Arvid Norberg
2012-06-09 16:58:16 +00:00
parent fa1c071c2f
commit f6450b91bb
5 changed files with 14 additions and 13 deletions

View File

@@ -161,10 +161,12 @@ void stop_proxy(int port)
}
}
void start_proxy(int port, int proxy_type)
int start_proxy(int proxy_type)
{
using namespace libtorrent;
int port = 10000 + (rand() % 50000);
stop_proxy(port);
char const* type = "";
@@ -203,6 +205,7 @@ void start_proxy(int port, int proxy_type)
fprintf(stderr, "launched\n");
// apparently delegate takes a while to open its listen port
test_sleep(500);
return port;
}
using namespace libtorrent;