mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-26 17:52:13 +01:00
i2p: cancel the Accept() method if waiting on the socket errors
This commit is contained in:
parent
aa69471ecd
commit
1c1467f51b
@ -147,7 +147,9 @@ bool Session::Accept(Connection& conn)
|
||||
try {
|
||||
while (!*m_interrupt) {
|
||||
Sock::Event occurred;
|
||||
conn.sock->Wait(MAX_WAIT_FOR_IO, Sock::RECV, &occurred);
|
||||
if (!conn.sock->Wait(MAX_WAIT_FOR_IO, Sock::RECV, &occurred)) {
|
||||
throw std::runtime_error("wait on socket failed");
|
||||
}
|
||||
|
||||
if ((occurred & Sock::RECV) == 0) {
|
||||
// Timeout, no incoming connections within MAX_WAIT_FOR_IO.
|
||||
|
Loading…
x
Reference in New Issue
Block a user