Changeset 333f806


Ignore:
Timestamp:
Oct 2, 2010 3:11:41 PM (10 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
f0f1a6f
Parents:
3489512
Message:
  • UDP:
    • Avoid rare AIOOBE
    • Comments
    • Logging cleanup
    • Comment out a main()
Location:
router/java/src/net/i2p/router/transport/udp
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • router/java/src/net/i2p/router/transport/udp/InboundEstablishState.java

    r3489512 r333f806  
    219219            _receivedIdentity = new byte[conf.readTotalFragmentNum()][];
    220220        int cur = conf.readCurrentFragmentNum();
     221        if (cur >= _receivedIdentity.length) {
     222            // avoid AIOOBE
     223            // should do more than this, but what? disconnect?
     224            fail();
     225            packetReceived();
     226            return;
     227        }
    221228        if (_receivedIdentity[cur] == null) {
    222229            byte fragment[] = new byte[conf.readCurrentFragmentSize()];
  • router/java/src/net/i2p/router/transport/udp/UDPPacket.java

    r3489512 r333f806  
    6868    public static final byte DATA_FLAG_EXPLICIT_ACK = (byte)(1 << 7);
    6969    public static final byte DATA_FLAG_ACK_BITFIELDS = (1 << 6);
     70    // unused
    7071    public static final byte DATA_FLAG_ECN = (1 << 4);
    7172    public static final byte DATA_FLAG_WANT_ACKS = (1 << 3);
    7273    public static final byte DATA_FLAG_WANT_REPLY = (1 << 2);
     74    // unused
    7375    public static final byte DATA_FLAG_EXTENDED = (1 << 1);
    7476   
  • router/java/src/net/i2p/router/transport/udp/UDPPacketReader.java

    r3489512 r333f806  
    757757   
    758758   
     759/******
    759760    public static void main(String args[]) {
    760761        I2PAppContext ctx = I2PAppContext.getGlobalContext();
     
    782783       
    783784    }
     785*******/
    784786}
  • router/java/src/net/i2p/router/transport/udp/UDPTransport.java

    r3489512 r333f806  
    946946                if (_introducersSelectedOn < _context.clock().now() - 10*60*1000) {
    947947                    if (_log.shouldLog(Log.WARN))
    948                         _log.warn("Our introducers are valid, but thy havent changed in a while, so lets rechoose");
     948                        _log.warn("Our introducers are valid, but havent changed in a while, so lets rechoose");
    949949                    return true;
    950950                } else {
     
    955955            } else {
    956956                if (_log.shouldLog(Log.INFO))
    957                     _log.info("Our introducers are not valid (" +valid + ")");
     957                    _log.info("Need more introducers (have " +valid + " need " + PUBLIC_RELAY_COUNT + ')');
    958958                return true;
    959959            }
     
    12341234                introducersIncluded = true;
    12351235            } else {
     1236                // FIXME
    12361237                // maybe we should fail to publish an address at all in this case?
     1238                // YES that would be better
    12371239                if (_log.shouldLog(Log.WARN))
    12381240                    _log.warn("Need introducers but we don't know any");
     
    13321334            case CommSystemFacade.STATUS_REJECT_UNSOLICITED:
    13331335            case CommSystemFacade.STATUS_DIFFERENT:
    1334                 if (_log.shouldLog(Log.INFO))
    1335                     _log.info("Require introducers, because our status is " + status);
     1336                if (_log.shouldLog(Log.DEBUG))
     1337                    _log.debug("Require introducers, because our status is " + status);
    13361338                return true;
    13371339            default:
    13381340                if (!allowDirectUDP()) {
    1339                     if (_log.shouldLog(Log.INFO))
    1340                         _log.info("Require introducers, because we do not allow direct UDP connections");
     1341                    if (_log.shouldLog(Log.DEBUG))
     1342                        _log.debug("Require introducers, because we do not allow direct UDP connections");
    13411343                    return true;
    13421344                }
Note: See TracChangeset for help on using the changeset viewer.