Changeset afb87cd for router


Ignore:
Timestamp:
Feb 5, 2017 7:09:12 PM (4 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
843b66d
Parents:
aa098ac
Message:

NTCP: Don't write to an inbound connection before established, causing NPE (ticket #996)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • router/java/src/net/i2p/router/transport/ntcp/NTCPConnection.java

    raa098ac rafb87cd  
    792792        if (_closed.get())
    793793            return;
    794         //if (_log.shouldLog(Log.DEBUG))
    795         //    _log.debug("prepare next write w/ isInbound? " + _isInbound + " established? " + _established);
    796         if (!_isInbound && !isEstablished()) {
     794        // Must be established or else session key is null and we can't encrypt
     795        // This is normal for OB conns but can happen rarely for IB also.
     796        // wantsWrite() is called at end of OB establishment, and
     797        // enqueueInfoMessage() is called at end of IB establishment.
     798        if (!isEstablished()) {
    797799            return;
    798800        }
Note: See TracChangeset for help on using the changeset viewer.