Changeset a6728a3


Ignore:
Timestamp:
Aug 29, 2011 5:53:01 PM (9 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
d73eb16
Parents:
20855c9
Message:

cleanups

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • history.txt

    r20855c9 ra6728a3  
     12011-08-29 zzz
     2  * NetDB:
     3    - Replace the old parallel lookup method with a true
     4      Kademlia lookup that iteratively queries additional floodfill
     5      peers returned in DatabaseSearchReplyMessages. This is a more
     6      efficient and reliable lookup that will work much better
     7      when not all floodfill peers are known, and it removes a serious
     8      limitation to network growth.
     9    - Limit max number of DSRM entries to look up
     10    - Cleanups, javadocs, log tweaks
     11  * Tunnels:
     12    - Increase timeouts on all deferred netdb lookups to 15s; add lookup stats
     13    - Cleanups, javadocs, log tweaks
     14
    1152011-08-28 zzz
    216  * checkcerts.sh: New test
  • router/java/src/net/i2p/data/i2np/I2NPMessage.java

    r20855c9 ra6728a3  
    6161   
    6262    /**
    63      * Replay resistent message Id
     63     * Replay resistant message ID
    6464     */
    6565    public long getUniqueId();
  • router/java/src/net/i2p/router/RouterVersion.java

    r20855c9 ra6728a3  
    1919    public final static String ID = "Monotone";
    2020    public final static String VERSION = CoreVersion.VERSION;
    21     public final static long BUILD = 3;
     21    public final static long BUILD = 4;
    2222
    2323    /** for example "-test" */
  • router/java/src/net/i2p/router/message/OutboundClientMessageOneShotJob.java

    r20855c9 ra6728a3  
    187187        }
    188188        if (_log.shouldLog(Log.DEBUG))
    189             _log.debug(getJobId() + ": Send outbound client message job beginning");
     189            _log.debug(getJobId() + ": Send outbound client message job beginning" +
     190                       ": preparing to search for the leaseSet for " + _toString);
    190191        long timeoutMs = _overallExpiration - now;
    191         if (_log.shouldLog(Log.DEBUG))
    192             _log.debug(getJobId() + ": preparing to search for the leaseSet for " + _toString);
    193192        Hash key = _to.calculateHash();
    194193        SendJob success = new SendJob(getContext());
    195         LookupLeaseSetFailedJob failed = new LookupLeaseSetFailedJob(getContext());
    196194        LeaseSet ls = getContext().netDb().lookupLeaseSetLocally(key);
    197195        if (ls != null) {
     
    205203            if (_log.shouldLog(Log.DEBUG))
    206204                _log.debug(getJobId() + ": Send outbound client message - sending off leaseSet lookup job for " + _toString);
     205            LookupLeaseSetFailedJob failed = new LookupLeaseSetFailedJob(getContext());
    207206            getContext().netDb().lookupLeaseSet(key, success, failed, timeoutMs);
    208207        }
     
    589588
    590589    private class DispatchJob extends JobImpl {
    591         private GarlicMessage _msg;
    592         private ReplySelector _selector;
    593         private SendSuccessJob _replyFound;
    594         private SendTimeoutJob _replyTimeout;
    595         private int _timeoutMs;
     590        private final GarlicMessage _msg;
     591        private final ReplySelector _selector;
     592        private final SendSuccessJob _replyFound;
     593        private final SendTimeoutJob _replyTimeout;
     594        private final int _timeoutMs;
     595
    596596        public DispatchJob(RouterContext ctx, GarlicMessage msg, ReplySelector sel, SendSuccessJob success, SendTimeoutJob timeout, int timeoutMs) {
    597597            super(ctx);
     
    602602            _timeoutMs = timeoutMs;
    603603        }
     604
    604605        public String getName() { return "Dispatch outbound client message"; }
     606
    605607        public void runJob() {
    606608            if (_selector != null)
     
    659661
    660662        public int hashCode() {
    661             return sh.hashCode() + dh.hashCode();
     663            return sh.hashCode() ^ dh.hashCode();
    662664        }
    663665
     
    950952     */
    951953    private class ReplySelector implements MessageSelector {
    952         private long _pendingToken;
     954        private final long _pendingToken;
     955
    953956        public ReplySelector(long token) {
    954957            _pendingToken = token;
     
    990993     */
    991994    private class SendSuccessJob extends JobImpl implements ReplyJob {
    992         private SessionKey _key;
    993         private TagSetHandle _tags;
     995        private final SessionKey _key;
     996        private final TagSetHandle _tags;
    994997       
    995998        /**
     
    10051008       
    10061009        public String getName() { return "Send client message successful"; }
     1010
    10071011        public void runJob() {
    10081012            // do we leak tags here?
     
    10551059     */
    10561060    private class SendTimeoutJob extends JobImpl {
    1057         private SessionKey _key;
    1058         private TagSetHandle _tags;
     1061        private final SessionKey _key;
     1062        private final TagSetHandle _tags;
    10591063
    10601064        public SendTimeoutJob(RouterContext enclosingContext, SessionKey key, TagSetHandle tags) {
     
    10651069       
    10661070        public String getName() { return "Send client message timed out"; }
     1071
    10671072        public void runJob() {
    10681073            if (_log.shouldLog(Log.INFO))
  • router/java/src/net/i2p/router/transport/udp/PacketHandler.java

    r20855c9 ra6728a3  
    127127   
    128128    private class Handler implements Runnable {
    129         private UDPPacketReader _reader;
    130         public volatile int _state;
     129        private final UDPPacketReader _reader;
     130        // TODO comment out all uses of _state
     131        public /* volatile */ int _state;
     132
    131133        public Handler() {
    132134            _reader = new UDPPacketReader(_context);
    133             _state = 0;
    134135        }
    135136       
     
    383384                    if (_log.shouldLog(Log.WARN))
    384385                        _log.warn("Invalid introduction packet received for inbound con, falling back: " + packet);
    385 
    386386                    _state = 33;
    387387                }
     
    421421                    if (_log.shouldLog(Log.INFO))
    422422                        _log.info("Valid introduction packet received for outbound established con: " + packet);
    423 
    424423                    _state = 37;
    425424                    packet.decrypt(state.getCipherKey());
Note: See TracChangeset for help on using the changeset viewer.