SAM: Accept fixes (Gitlab #399)

This commit is contained in:
zzz
2023-09-29 09:57:12 +00:00
parent a343f781d0
commit 0ba97ed4cd
4 changed files with 63 additions and 7 deletions
@@ -372,7 +372,7 @@ public class I2PSocketManagerFull implements I2PSocketManager {
* incoming connections on a subsession.
*
* @return connected I2PSocket, or null through 0.9.16, non-null as of 0.9.17
* @throws I2PException if session is closed
* @throws I2PException if session is closed; as of 0.9.60, this is an I2PSessionException which extends I2PException
* @throws net.i2p.client.streaming.RouterRestartException (extends I2PException) if the router is apparently restarting, since 0.9.34
* @throws ConnectException (since 0.9.17; I2PServerSocket interface always declared it)
* @throws SocketTimeoutException if a timeout was previously set with setSoTimeout and the timeout has been reached.
@@ -523,14 +523,20 @@ public class I2PSocketManagerFull implements I2PSocketManager {
return _realServerSocket;
}
/**
* @throws I2PException if session is closed; as of 0.9.60, this is an I2PSessionException which extends I2PException
*/
private void verifySession() throws I2PException {
verifySession(_connectionManager.getSession());
}
/** @since 0.9.21 */
/**
* @throws I2PException if session is closed; as of 0.9.60, this is an I2PSessionException which extends I2PException
* @since 0.9.21
*/
private void verifySession(I2PSession session) throws I2PException {
if (_isDestroyed.get())
throw new I2PException("Session was closed");
throw new I2PSessionException("Session was closed");
if (!session.isClosed())
return;
session.connect();