mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-10 10:52:31 -05: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 {
|
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.
|
||||||
|
|
Loading…
Add table
Reference in a new issue