forked from I2P_Developers/i2p.i2p
I2CP: Prevent sending data message before handshake with router is complete
This commit is contained in:
@ -619,6 +619,8 @@ public abstract class I2PSessionImpl implements I2PSession, I2CPMessageReader.I2
|
||||
throw new I2PSessionException("Already closed");
|
||||
if (_state == State.INIT)
|
||||
throw new I2PSessionException("Not open, must call connect() first");
|
||||
if (_state == State.OPENING) // not before GOTDATE
|
||||
throw new I2PSessionException("Session not open yet");
|
||||
}
|
||||
_producer.reportAbuse(this, msgId, severity);
|
||||
}
|
||||
|
@ -252,6 +252,8 @@ class I2PSessionImpl2 extends I2PSessionImpl {
|
||||
throw new I2PSessionException("Already closed");
|
||||
if (_state == State.INIT)
|
||||
throw new I2PSessionException("Not open, must call connect() first");
|
||||
if (_state == State.OPENING || _state == State.GOTDATE) // not before GOTDATE or session
|
||||
throw new I2PSessionException("Session not open yet");
|
||||
}
|
||||
updateActivity();
|
||||
|
||||
|
@ -261,6 +261,8 @@ class I2PSessionMuxedImpl extends I2PSessionImpl2 {
|
||||
throw new I2PSessionException("Already closed");
|
||||
if (_state == State.INIT)
|
||||
throw new I2PSessionException("Not open, must call connect() first");
|
||||
if (_state == State.OPENING || _state == State.GOTDATE) // not before GOTDATE or session
|
||||
throw new I2PSessionException("Session not open yet");
|
||||
}
|
||||
updateActivity();
|
||||
|
||||
|
Reference in New Issue
Block a user