Skip to content

Commit 7d3662f

Browse files
brunoergvasild
andcommitted
i2p: fix log when an interruption happens during Accept
Before, interruption was printed as an error. Also, it did not log the reason when an interruption happened, e.g. "Error accepting:". Co-authored-by: Vasil Dimov <vd@FreeBSD.org>
1 parent 3d3a83f commit 7d3662f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/i2p.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,11 @@ bool Session::Accept(Connection& conn)
202202
return true;
203203
}
204204

205-
LogPrintLevel(BCLog::I2P, BCLog::Level::Debug, "Error accepting%s: %s\n", disconnect ? " (will close the session)" : "", errmsg);
205+
if (*m_interrupt) {
206+
LogPrintLevel(BCLog::I2P, BCLog::Level::Debug, "Accept was interrupted\n");
207+
} else {
208+
LogPrintLevel(BCLog::I2P, BCLog::Level::Debug, "Error accepting%s: %s\n", disconnect ? " (will close the session)" : "", errmsg);
209+
}
206210
if (disconnect) {
207211
LOCK(m_mutex);
208212
Disconnect();

0 commit comments

Comments
 (0)