I2CP: Add PROP_GZIP

i2ptunnel: Disable I2CP gzip for HTTP server tunnels
i2psnark: Disable I2CP gzip
This commit is contained in:
zzz
2020-05-02 22:16:39 +00:00
parent 47f09479ad
commit 0528e4109d
5 changed files with 19 additions and 2 deletions

View File

@ -70,6 +70,8 @@ public interface I2PClient {
public static final String PROP_USER = "i2cp.username";
/** @since 0.9.44, was protected in I2PSessionImpl */
public static final String PROP_PW = "i2cp.password";
/** @since 0.9.46 */
public static final String PROP_GZIP = "i2cp.gzip";
/**
* 7654

View File

@ -188,7 +188,7 @@ class I2PSessionImpl2 extends I2PSessionImpl {
protected boolean shouldCompress(int size) {
if (size <= DONT_COMPRESS_SIZE)
return false;
String p = getOptions().getProperty("i2cp.gzip");
String p = getOptions().getProperty(I2PClient.PROP_GZIP);
if (p != null)
return Boolean.parseBoolean(p);
return SHOULD_COMPRESS;