mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 10:43:19 -03:00
i2p: cancel the Accept() method if waiting on the socket errors
This commit is contained in:
parent
aa69471ecd
commit
1c1467f51b
1 changed files with 3 additions and 1 deletions
|
@ -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…
Add table
Reference in a new issue