Skip to content
Snippets Groups Projects
Commit b02e9cff authored by Adrien Béraud's avatar Adrien Béraud
Browse files

peerdiscovery: flush stop socket if not stopping

parent 453db290
Branches
Tags
No related merge requests found
...@@ -250,7 +250,10 @@ PeerDiscovery::listener_thread(PeerDiscoveredCallback callback) ...@@ -250,7 +250,10 @@ PeerDiscovery::listener_thread(PeerDiscoveredCallback callback)
} }
if (data_coming > 0) { if (data_coming > 0) {
if (FD_ISSET(stop_readfd, &readfds)) { break; } if (FD_ISSET(stop_readfd, &readfds)) {
std::array<uint8_t, 64 * 1024> buf;
recv(stop_readfd, buf.data(), buf.size(), 0);
}
std::array<uint8_t,dht::InfoHash::size() + sizeof(in_port_t)> data_receive; std::array<uint8_t,dht::InfoHash::size() + sizeof(in_port_t)> data_receive;
size_t data_receive_size = data_receive.size(); size_t data_receive_size = data_receive.size();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment