Changeset 8655988


Ignore:
Timestamp:
Aug 30, 2013 12:01:51 PM (8 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
6ca797e
Parents:
de5f294
Message:
  • NTCP: Handle race where peer's NTCP address goes away
File:
1 edited

Legend:

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

    rde5f294 r8655988  
    213213            NTCPConnection con = null;
    214214            boolean isNew = false;
     215            boolean fail = false;
    215216            synchronized (_conLock) {
    216217                con = _conByIdent.get(ih);
     
    224225                        _conByIdent.put(ih, con);
    225226                    } else {
    226                         _log.error("we bid on a peer who doesn't have an ntcp address? " + target);
    227                         return;
     227                        // race, RI changed out from under us
     228                        // call afterSend below outside of conLock
     229                        fail = true;
    228230                    }
    229231                }
     232            }
     233            if (fail) {
     234                // race, RI changed out from under us, maybe SSU can handle it
     235                if (_log.shouldLog(Log.WARN))
     236                    _log.warn("we bid on a peer who doesn't have an ntcp address? " + target);
     237                afterSend(msg, false);
     238                return;
    230239            }
    231240            if (isNew) {
Note: See TracChangeset for help on using the changeset viewer.