1
0
mirror of https://github.com/asamy/ctorrent synced 2025-10-05 15:42:48 +02:00

tracker/udp: fix uninitialized variable

This commit is contained in:
Ahmed Samy
2017-02-12 23:21:49 +02:00
parent 6ec34f2a98
commit a356ab08f4
2 changed files with 2 additions and 2 deletions

View File

@@ -178,7 +178,7 @@ bool Tracker::udpRequest(const TrackerQuery &r)
boost::asio::socket_base::non_blocking_io command(true);
socket.io_control(command);
int len;
int len = 0;
for (int tries = 0; tries < 10 && len != 16; ++tries) {
len = socket.receive_from(asio::buffer(buf, 16), r_endpoint, 0, error);
std::this_thread::sleep_for(std::chrono::milliseconds(tries * 30));

View File

@@ -216,7 +216,7 @@ int main(int argc, char *argv[])
break;
default:
errors |= 1 << i;
std::cerr << "Failed" << std::endl;
std::cerr << "Failed: " << (int)state << std::endl;
break;
}
}