aboutsummaryrefslogtreecommitdiff
path: root/src/i2p.h
diff options
context:
space:
mode:
authorVasil Dimov <vd@FreeBSD.org>2023-07-14 15:17:43 +0200
committerVasil Dimov <vd@FreeBSD.org>2023-10-05 14:11:13 +0200
commit5c8e15c451ec870b9dd4eb843ec6ca3ba64cda4f (patch)
tree8417ca19e5bc1336e2c6dcddb5ff92da972fcea5 /src/i2p.h
parent762404a68c114e8831cdfae937627174544b55a7 (diff)
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.
Diffstat (limited to 'src/i2p.h')
-rw-r--r--src/i2p.h2
1 files changed, 1 insertions, 1 deletions
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.