fix bug in port randomization in unit tests
This commit is contained in:
parent
53a95fbcc1
commit
d327916c27
|
@ -402,15 +402,17 @@ int start_proxy(int proxy_type)
|
||||||
{
|
{
|
||||||
using namespace libtorrent;
|
using namespace libtorrent;
|
||||||
|
|
||||||
std::srand((unsigned int)total_microseconds(time_now() - min_time()));
|
|
||||||
int port = 5000 + (rand() % 55000);
|
|
||||||
|
|
||||||
for (std::map<int, proxy_t>::iterator i = running_proxies.begin()
|
for (std::map<int, proxy_t>::iterator i = running_proxies.begin()
|
||||||
, end(running_proxies.end()); i != end; ++i)
|
, end(running_proxies.end()); i != end; ++i)
|
||||||
{
|
{
|
||||||
if (i->second.type == proxy_type) return i->first;
|
if (i->second.type == proxy_type) return i->first;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned int seed = total_microseconds(time_now_hires() - min_time());
|
||||||
|
printf("random seed: %u\n", seed);
|
||||||
|
std::srand(seed);
|
||||||
|
int port = 5000 + (rand() % 55000);
|
||||||
|
|
||||||
char const* type = "";
|
char const* type = "";
|
||||||
char const* auth = "";
|
char const* auth = "";
|
||||||
char const* cmd = "";
|
char const* cmd = "";
|
||||||
|
|
Loading…
Reference in New Issue