Streaming: Promote profile properties to interface

i2ptunnel: set bulk profile for servers;
i2psnark: set bulk profile;
Prep for tunnel bw params (proposal 168)
This commit is contained in:
zzz
2025-02-21 10:22:24 -05:00
parent fbd0be941a
commit c248a999a4
4 changed files with 17 additions and 4 deletions

View File

@ -336,6 +336,8 @@ public class I2PSnarkUtil implements DisconnectListener {
opts.setProperty("i2p.streaming.disableRejectLogging", "true");
if (opts.getProperty("i2p.streaming.answerPings") == null)
opts.setProperty("i2p.streaming.answerPings", "false");
if (opts.getProperty(I2PSocketOptions.PROP_PROFILE) == null)
opts.setProperty(I2PSocketOptions.PROP_PROFILE, Integer.toString(I2PSocketOptions.PROFILE_BULK));
if (opts.getProperty(I2PClient.PROP_SIGTYPE) == null)
opts.setProperty(I2PClient.PROP_SIGTYPE, "EdDSA_SHA512_Ed25519");
if (opts.getProperty("i2cp.leaseSetEncType") == null)

View File

@ -18,6 +18,7 @@ import net.i2p.client.I2PClient;
import net.i2p.client.I2PClientFactory;
import net.i2p.client.I2PSession;
import net.i2p.client.I2PSessionException;
import net.i2p.client.streaming.I2PSocketOptions;
import net.i2p.crypto.KeyGenerator;
import net.i2p.crypto.SigType;
import net.i2p.data.DataHelper;
@ -949,6 +950,8 @@ public class TunnelController implements Logging {
_config.setProperty(OPT_POST_TOTAL_MAX, Integer.toString(I2PTunnelHTTPServer.DEFAULT_POST_TOTAL_MAX));
}
}
if (!_config.containsKey(I2PSocketOptions.PROP_PROFILE))
_config.setProperty(I2PSocketOptions.PROP_PROFILE, Integer.toString(I2PSocketOptions.PROFILE_BULK));
}
if (isClient(type) &&
(type.equals(TYPE_HTTP_CLIENT) || Boolean.parseBoolean(_config.getProperty(PROP_SHARED)))) {

View File

@ -13,6 +13,18 @@ public interface I2PSocketOptions {
public static final String PROP_READ_TIMEOUT = "i2p.streaming.readTimeout";
/** How long to block on write/flush */
public static final String PROP_WRITE_TIMEOUT = "i2p.streaming.writeTimeout";
/**
* @since 0.9.66 promoted from ConnectionOptions
*/
public static final String PROP_PROFILE = "i2p.streaming.profile";
/**
* @since 0.9.66 promoted from ConnectionOptions
*/
public static final int PROFILE_BULK = 1;
/**
* @since 0.9.66 promoted from ConnectionOptions
*/
public static final int PROFILE_INTERACTIVE = 2;
/**
* How long we will wait for the ACK from a SYN, in milliseconds.

View File

@ -70,9 +70,6 @@ class ConnectionOptions extends I2PSocketOptionsImpl {
// NOTE - almost all the options are below, but see
// I2PSocketOptions in ministreaming for a few more
public static final int PROFILE_BULK = 1;
public static final int PROFILE_INTERACTIVE = 2;
/** on inactivity timeout, do nothing */
public static final int INACTIVITY_ACTION_NOOP = 0;
@ -93,7 +90,6 @@ class ConnectionOptions extends I2PSocketOptionsImpl {
private static final int INITIAL_RTO = 9000;
public static final String PROP_CONNECT_DELAY = "i2p.streaming.connectDelay";
public static final String PROP_PROFILE = "i2p.streaming.profile";
public static final String PROP_MAX_MESSAGE_SIZE = "i2p.streaming.maxMessageSize";
public static final String PROP_MAX_RESENDS = "i2p.streaming.maxResends";
public static final String PROP_INITIAL_RESEND_DELAY = "i2p.streaming.initialResendDelay";