Changeset dd0153e2 for router


Ignore:
Timestamp:
Apr 13, 2017 3:58:52 PM (3 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
f8ea882
Parents:
9dd1466
Message:

SSU: Publish introducer expiration (proposal 133)

Location:
router/java/src/net/i2p/router
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • router/java/src/net/i2p/router/RouterVersion.java

    r9dd1466 rdd0153e2  
    1919    public final static String ID = "Monotone";
    2020    public final static String VERSION = CoreVersion.VERSION;
    21     public final static long BUILD = 15;
     21    public final static long BUILD = 16;
    2222
    2323    /** for example "-test" */
    24     public final static String EXTRA = "";
     24    public final static String EXTRA = "-rc";
    2525    public final static String FULL_VERSION = VERSION + "-" + BUILD + EXTRA;
    2626    public static void main(String args[]) {
  • router/java/src/net/i2p/router/transport/udp/IntroductionManager.java

    r9dd1466 rdd0153e2  
    100100    /** Max for all targets per PUNCH_CLEAN_TIME */
    101101    private static final int MAX_PUNCHES = 8;
     102    private static final long INTRODUCER_EXPIRATION = 80*60*1000L;
    102103
    103104    public IntroductionManager(RouterContext ctx, UDPTransport transport) {
     
    179180        start = start % sz;
    180181        int found = 0;
    181         long inactivityCutoff = _context.clock().now() - (UDPTransport.EXPIRE_TIMEOUT / 2);    // 15 min
     182        long now = _context.clock().now();
     183        long inactivityCutoff = now - (UDPTransport.EXPIRE_TIMEOUT / 2);    // 15 min
    182184        // if not too many to choose from, be less picky
    183185        if (sz <= howMany + 2)
     
    236238        // we sort them so a change in order only won't happen, and won't cause a republish
    237239        Collections.sort(introducers);
     240        String exp = Long.toString((now + INTRODUCER_EXPIRATION) / 1000);
    238241        for (int i = 0; i < found; i++) {
    239242            Introducer in = introducers.get(i);
     
    242245            ssuOptions.setProperty(UDPAddress.PROP_INTRO_KEY_PREFIX + i, in.skey);
    243246            ssuOptions.setProperty(UDPAddress.PROP_INTRO_TAG_PREFIX + i, in.stag);
     247            ssuOptions.setProperty(UDPAddress.PROP_INTRO_EXP_PREFIX + i, exp);
    244248        }
    245249
Note: See TracChangeset for help on using the changeset viewer.