From 5c8e15c451ec870b9dd4eb843ec6ca3ba64cda4f Mon Sep 17 00:00:00 2001 From: Vasil Dimov Date: Fri, 14 Jul 2023 15:17:43 +0200 Subject: i2p: destroy the session if we get an unexpected error from the I2P router From https://geti2p.net/en/docs/api/samv3: If SILENT=false was passed, which is the default value, the SAM bridge sends the client a ASCII line containing the base64 public destination key of the requesting peer So, `Accept()` is supposed to receive a Base64 encoded destination of the connecting peer, but if it receives something like this instead: STREAM STATUS RESULT=I2P_ERROR MESSAGE="Session was closed" then destroy the session. --- src/i2p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/i2p.h') diff --git a/src/i2p.h b/src/i2p.h index cb9da64816..375abaccfc 100644 --- a/src/i2p.h +++ b/src/i2p.h @@ -105,7 +105,7 @@ public: * completion the `peer` member will be set to the address of the incoming peer. * @return true on success */ - bool Accept(Connection& conn); + bool Accept(Connection& conn) EXCLUSIVE_LOCKS_REQUIRED(!m_mutex); /** * Connect to an I2P peer. -- cgit v1.2.3