Changeset ce96234


Ignore:
Timestamp:
Nov 21, 2015 7:45:54 PM (5 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
1215a70, 9bb1a00
Parents:
d30c1ec
Message:

SSU ext. options:

  • don't ask for intro if he is indirect
  • ask for intro if our state is unknown
  • debug logging
  • change min to 0.9.23 for testing
Location:
router/java/src/net/i2p/router/transport/udp
Files:
4 edited

Legend:

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

    rd30c1ec rce96234  
    133133     * No matter, the options weren't defined until this release anyway.
    134134     *
    135      * FIXME 0.9.22 for testing, change to 0.9.24 for release
     135**********************************************************************************************************
     136     * FIXME 0.9.23 for testing, change to 0.9.24 for release
    136137     *
    137138     */
    138     private static final String VERSION_ALLOW_EXTENDED_OPTIONS = "0.9.22";
     139    private static final String VERSION_ALLOW_EXTENDED_OPTIONS = "0.9.23";
    139140    private static final String PROP_DISABLE_EXT_OPTS = "i2np.udp.disableExtendedOptions";
    140141
     
    374375                                                   && !_context.getBooleanProperty(PROP_DISABLE_EXT_OPTS);
    375376                    // w/o ext options, it's always 'requested', no need to set
    376                     boolean requestIntroduction = allowExtendedOptions && _transport.introducersRequired();
     377                    // don't ask if they are indirect
     378                    boolean requestIntroduction = allowExtendedOptions && !isIndirect &&
     379                                                  _transport.introducersMaybeRequired();
    377380                    state = new OutboundEstablishState(_context, maybeTo, to,
    378381                                                       toIdentity, allowExtendedOptions,
  • router/java/src/net/i2p/router/transport/udp/InboundEstablishState.java

    rd30c1ec rce96234  
    156156        if (ext != null && ext.length >= UDPPacket.SESS_REQ_MIN_EXT_OPTIONS_LENGTH) {
    157157            _introductionRequested = (ext[1] & (byte) UDPPacket.SESS_REQ_EXT_FLAG_REQUEST_RELAY_TAG) != 0;
     158            if (_log.shouldInfo())
     159                _log.info("got sess req. w/ ext. options, need intro? " + _introductionRequested + ' ' + this);
    158160        }
    159161        if (_log.shouldLog(Log.DEBUG))
  • router/java/src/net/i2p/router/transport/udp/PacketBuilder.java

    rd30c1ec rce96234  
    789789        if (ext) {
    790790            options = new byte[UDPPacket.SESS_REQ_MIN_EXT_OPTIONS_LENGTH];
    791             if (state.needIntroduction())
     791            boolean intro = state.needIntroduction();
     792            if (intro)
    792793                options[1] = (byte) UDPPacket.SESS_REQ_EXT_FLAG_REQUEST_RELAY_TAG;
     794            if (_log.shouldInfo())
     795                _log.info("send sess req. w/ ext. options, need intro? " + intro + ' ' + state);
    793796            off += UDPPacket.SESS_REQ_MIN_EXT_OPTIONS_LENGTH + 1;
    794797        } else {
  • router/java/src/net/i2p/router/transport/udp/UDPTransport.java

    rd30c1ec rce96234  
    22172217                    _log.debug("Require introducers, because our status is " + status);
    22182218                return true;
     2219
    22192220            default:
    22202221                if (!allowDirectUDP()) {
     
    22242225                }
    22252226                return false;
     2227        }
     2228    }
     2229   
     2230    /**
     2231     *  MIGHT we require introducers?
     2232     *  This is like introducersRequired, but if we aren't sure, this returns true.
     2233     *  Used only by EstablishmentManager.
     2234     *
     2235     *  @since 0.9.24
     2236     */
     2237    boolean introducersMaybeRequired() {
     2238        Status status = getReachabilityStatus();
     2239        switch (status) {
     2240            case REJECT_UNSOLICITED:
     2241            case DIFFERENT:
     2242            case IPV4_FIREWALLED_IPV6_OK:
     2243            case IPV4_FIREWALLED_IPV6_UNKNOWN:
     2244            case IPV4_UNKNOWN_IPV6_OK:
     2245            case IPV4_UNKNOWN_IPV6_FIREWALLED:
     2246            case UNKNOWN:
     2247                return true;
     2248
     2249            default:
     2250                return !allowDirectUDP();
    22262251        }
    22272252    }
Note: See TracChangeset for help on using the changeset viewer.