Changeset fb64118


Ignore:
Timestamp:
Dec 2, 2014 1:42:58 PM (6 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
78d7277
Parents:
4b2715c
Message:

use new getVersion()

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

Legend:

Unmodified
Added
Removed
  • router/java/src/net/i2p/data/i2np/DatabaseLookupMessage.java

    r4b2715c rfb64118  
    215215        if (to == null)
    216216            return false;
    217         String v = to.getOption("router.version");
    218         return v != null &&
    219                VersionComparator.comp(v, MIN_ENCRYPTION_VERSION) >= 0;
     217        String v = to.getVersion();
     218        return VersionComparator.comp(v, MIN_ENCRYPTION_VERSION) >= 0;
    220219    }
    221220   
  • router/java/src/net/i2p/router/networkdb/kademlia/StoreJob.java

    r4b2715c rfb64118  
    514514     */
    515515    private static boolean supportsEncryption(RouterInfo ri) {
    516         String v = ri.getOption("router.version");
    517         if (v == null)
    518             return false;
     516        String v = ri.getVersion();
    519517        return VersionComparator.comp(v, MIN_ENCRYPTION_VERSION) >= 0;
    520518    }
     
    536534        if (type == null)
    537535            return false;
    538         String v = ri.getOption("router.version");
    539         if (v == null)
    540             return false;
     536        String v = ri.getVersion();
    541537        String since = type.getSupportedSince();
    542538        return VersionComparator.comp(v, since) >= 0;
     
    550546     */
    551547    public static boolean supportsBigLeaseSets(RouterInfo ri) {
    552         String v = ri.getOption("router.version");
    553         if (v == null)
    554             return false;
     548        String v = ri.getVersion();
    555549        return VersionComparator.comp(v, MIN_BIGLEASESET_VERSION) >= 0;
    556550    }
  • router/java/src/net/i2p/router/peermanager/ProfileOrganizer.java

    r4b2715c rfb64118  
    698698                RouterInfo info = _context.netDb().lookupRouterInfoLocally(peer);
    699699                if (info != null) {
    700                     String v = info.getOption("router.version");
     700                    String v = info.getVersion();
    701701                    // this only works if there is no 0.6.1.34!
    702                     if (v != null && (!v.equals("0.6.1.33")) &&
     702                    if ((!v.equals("0.6.1.33")) &&
    703703                        v.startsWith("0.6.1.") && info.getTargetAddress("NTCP") == null)
    704704                        l.add(peer);
  • router/java/src/net/i2p/router/transport/ntcp/NTCPTransport.java

    r4b2715c rfb64118  
    376376            RouterIdentity id = us.getIdentity();
    377377            if (id.getSigType() != SigType.DSA_SHA1) {
    378                 String v = toAddress.getOption("router.version");
    379                 if (v != null && VersionComparator.comp(v, MIN_SIGTYPE_VERSION) < 0) {
     378                String v = toAddress.getVersion();
     379                if (VersionComparator.comp(v, MIN_SIGTYPE_VERSION) < 0) {
    380380                    markUnreachable(peer);
    381381                    return null;
  • router/java/src/net/i2p/router/transport/udp/UDPTransport.java

    r4b2715c rfb64118  
    12331233                }
    12341234                markUnreachable(peerHash);
    1235                 _context.banlist().banlistRouter(peerHash, "Part of the wrong network, version = " + ((RouterInfo) entry).getOption("router.version"));
     1235                _context.banlist().banlistRouter(peerHash, "Part of the wrong network, version = " + ((RouterInfo) entry).getVersion());
    12361236                //_context.banlist().banlistRouter(peerHash, "Part of the wrong network", STYLE);
    12371237                dropPeer(peerHash, false, "wrong network");
     
    15791579                RouterIdentity id = us.getIdentity();
    15801580                if (id.getSigType() != SigType.DSA_SHA1) {
    1581                     String v = toAddress.getOption("router.version");
    1582                     if (v != null && VersionComparator.comp(v, MIN_SIGTYPE_VERSION) < 0) {
     1581                    String v = toAddress.getVersion();
     1582                    if (VersionComparator.comp(v, MIN_SIGTYPE_VERSION) < 0) {
    15831583                        markUnreachable(to);
    15841584                        return null;
  • router/java/src/net/i2p/router/tunnel/pool/BuildRequestor.java

    r4b2715c rfb64118  
    239239        if (ri == null)
    240240            return false;
    241         String v = ri.getOption("router.version");
    242         if (v == null)
    243             return false;
     241        String v = ri.getVersion();
    244242        return VersionComparator.comp(v, MIN_VARIABLE_VERSION) >= 0;
    245243    }
  • router/java/src/net/i2p/router/tunnel/pool/TunnelPeerSelector.java

    r4b2715c rfb64118  
    350350            for (int i = 0; i < known.size(); i++) {
    351351                RouterInfo peer = known.get(i);
    352                 String v = peer.getOption("router.version");
    353                 if (v == null)
    354                     continue;
     352                String v = peer.getVersion();
    355353                // RI sigtypes added in 0.9.16
    356354                // SSU inbound connection bug fixed in 0.9.17, but it won't bid, so NTCP only,
     
    403401
    404402        // minimum version check
    405         String v = peer.getOption("router.version");
    406         if (v == null || VersionComparator.comp(v, MIN_VERSION) < 0)
     403        String v = peer.getVersion();
     404        if (VersionComparator.comp(v, MIN_VERSION) < 0)
    407405            return true;
    408406
Note: See TracChangeset for help on using the changeset viewer.