mirror of
https://github.com/i2p/i2p.i2p.git
synced 2026-10-25 01:52:46 +00:00
NTCP: Don't write to an inbound connection before established, causing NPE (ticket #996)
This commit is contained in:
1 parent
aa098ac800
commit
afb87cd75c
1 file changed
+5
-3
@@ -791,9 +791,11 @@ class NTCPConnection implements Closeable {
|
||||
private void prepareNextWriteFast(PrepBuffer buf) {
|
||||
if (_closed.get())
|
||||
return;
|
||||
//if (_log.shouldLog(Log.DEBUG))
|
||||
// _log.debug("prepare next write w/ isInbound? " + _isInbound + " established? " + _established);
|
||||
if (!_isInbound && !isEstablished()) {
|
||||
// Must be established or else session key is null and we can't encrypt
|
||||
// This is normal for OB conns but can happen rarely for IB also.
|
||||
// wantsWrite() is called at end of OB establishment, and
|
||||
// enqueueInfoMessage() is called at end of IB establishment.
|
||||
if (!isEstablished()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user