diff --git a/core/java/src/net/i2p/client/I2PSessionImpl.java b/core/java/src/net/i2p/client/I2PSessionImpl.java index 7527dd8862e04b860a327a434ef06e57379e12a9..a6652556ce4c1cbd24042163c52099c9aa310d75 100644 --- a/core/java/src/net/i2p/client/I2PSessionImpl.java +++ b/core/java/src/net/i2p/client/I2PSessionImpl.java @@ -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); } diff --git a/core/java/src/net/i2p/client/I2PSessionImpl2.java b/core/java/src/net/i2p/client/I2PSessionImpl2.java index 5cd2b930c4295776e164815acce960a22f6ae9d4..d58f5b5f140cd9e272fae82f4edd78333fc56dc3 100644 --- a/core/java/src/net/i2p/client/I2PSessionImpl2.java +++ b/core/java/src/net/i2p/client/I2PSessionImpl2.java @@ -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(); diff --git a/core/java/src/net/i2p/client/I2PSessionMuxedImpl.java b/core/java/src/net/i2p/client/I2PSessionMuxedImpl.java index 0185496aa3aceea641ed8b587274bcdb5b68edd2..94eb6ae451459382f9d5d29792560e45c61282df 100644 --- a/core/java/src/net/i2p/client/I2PSessionMuxedImpl.java +++ b/core/java/src/net/i2p/client/I2PSessionMuxedImpl.java @@ -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();