mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
i2p: cancel the Accept() method if waiting on the socket errors
This commit is contained in:
@@ -147,7 +147,9 @@ bool Session::Accept(Connection& conn)
|
|||||||
try {
|
try {
|
||||||
while (!*m_interrupt) {
|
while (!*m_interrupt) {
|
||||||
Sock::Event occurred;
|
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) {
|
if ((occurred & Sock::RECV) == 0) {
|
||||||
// Timeout, no incoming connections within MAX_WAIT_FOR_IO.
|
// Timeout, no incoming connections within MAX_WAIT_FOR_IO.
|
||||||
|
|||||||
Reference in New Issue
Block a user