SSU: Add option to disable extended options

Fix max payload type
This commit is contained in:
zzz
2015-11-19 14:15:28 +00:00
parent 46f42432a2
commit 8d9d3fcf95
2 changed files with 4 additions and 2 deletions

View File

@@ -136,6 +136,7 @@ class EstablishmentManager {
*
*/
private static final String VERSION_ALLOW_EXTENDED_OPTIONS = "0.9.22";
private static final String PROP_DISABLE_EXT_OPTS = "i2np.udp.disableExtendedOptions";
public EstablishmentManager(RouterContext ctx, UDPTransport transport) {
@@ -369,7 +370,8 @@ class EstablishmentManager {
return;
}
boolean allowExtendedOptions = VersionComparator.comp(toRouterInfo.getVersion(),
VERSION_ALLOW_EXTENDED_OPTIONS) >= 0;
VERSION_ALLOW_EXTENDED_OPTIONS) >= 0
&& !_context.getBooleanProperty(PROP_DISABLE_EXT_OPTS);
// w/o ext options, it's always 'requested', no need to set
boolean requestIntroduction = allowExtendedOptions && _transport.introducersRequired();
state = new OutboundEstablishState(_context, maybeTo, to,

View File

@@ -85,9 +85,9 @@ class UDPPacket implements CDQEntry {
public static final int PAYLOAD_TYPE_RELAY_INTRO = 5;
public static final int PAYLOAD_TYPE_DATA = 6;
public static final int PAYLOAD_TYPE_TEST = 7;
public static final int MAX_PAYLOAD_TYPE = PAYLOAD_TYPE_TEST;
/** @since 0.8.1 */
public static final int PAYLOAD_TYPE_SESSION_DESTROY = 8;
public static final int MAX_PAYLOAD_TYPE = PAYLOAD_TYPE_SESSION_DESTROY;
// various flag fields for use in the header
/**