Changeset c455f15b


Ignore:
Timestamp:
Aug 16, 2018 6:39:07 PM (22 months ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
11945c8, 211533f, 7cf79a3, 8bebda2e
Parents:
30fefa4
Message:

i2ptunnel: Change read timeout defaults now that streaming read timeout works

Files:
9 edited

Legend:

Unmodified
Added
Removed
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelClient.java

    r30fefa4 rc455f15b  
    3333     */
    3434    private final List<I2PSocketAddress> _addrs;
    35     private static final long DEFAULT_READ_TIMEOUT = 5*60*1000; // -1
     35    // We don't know what protocol, so we assume the application has its own timeout mechanism
     36    private static final long DEFAULT_READ_TIMEOUT = -1;
    3637    protected long readTimeout = DEFAULT_READ_TIMEOUT;
    3738    private InternalSocketRunner _isr;
     
    108109    }
    109110
     111    /**
     112     *  Set the read idle timeout for newly-created connections (in
     113     *  milliseconds).  After this time expires without data being reached from
     114     *  the I2P network, the connection itself will be closed.
     115     *
     116     *  Less than or equal to 0 means forever.
     117     *  Default -1 (forever) as of 0.9.36 for standard tunnels,
     118     *  but extending classes may override.
     119     *  Prior to that, default was 5 minutes, but did not work
     120     *  due to streaming bugs.
     121     *
     122     *  Applies only to future connections;
     123     *  calling this does not affect existing connections.
     124     *
     125     *  @param ms in ms
     126     */
    110127    public void setReadTimeout(long ms) { readTimeout = ms; }
     128
     129    /**
     130     *  Get the read idle timeout for newly-created connections (in
     131     *  milliseconds).
     132     *
     133     *  Less than or equal to 0 means forever.
     134     *  Default -1 (forever) as of 0.9.36 for standard tunnels,
     135     *  but extending classes may override.
     136     *  Prior to that, default was 5 minutes, but did not work
     137     *  due to streaming bugs.
     138     *
     139     *  @return in ms
     140     */
    111141    public long getReadTimeout() { return readTimeout; }
    112142   
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClientBase.java

    r30fefa4 rc455f15b  
    138138    }
    139139
    140     protected static final int DEFAULT_READ_TIMEOUT = 5*60*1000;
     140    /**
     141     *  -1 (forever) as of 0.9.36,
     142     *  so that large POSTs won't timeout on the read side
     143     */
     144    protected static final int DEFAULT_READ_TIMEOUT = -1;
    141145   
    142146    protected static final AtomicLong __requestId = new AtomicLong();
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPServer.java

    r30fefa4 rc455f15b  
    8989    /** Includes request, just to prevent OOM DOS @since 0.9.20 */
    9090    private static final int MAX_TOTAL_HEADER_SIZE = 32*1024;
     91    // Does not apply to header reads.
     92    // We set it to forever so that it won't timeout when sending a large response.
     93    // The server will presumably have its own timeout implemented for POST
     94    private static final long DEFAULT_HTTP_READ_TIMEOUT = -1;
    9195   
    9296    private long _startedOn = 0L;
     
    206210        _spoofHost = (spoofHost != null && spoofHost.trim().length() > 0) ? spoofHost.trim() : null;
    207211        getTunnel().getContext().statManager().createRateStat("i2ptunnel.httpserver.blockingHandleTime", "how long the blocking handle takes to complete", "I2PTunnel.HTTPServer", new long[] { 60*1000, 10*60*1000, 3*60*60*1000 });
     212        readTimeout = DEFAULT_HTTP_READ_TIMEOUT;
    208213    }
    209214
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelIRCClient.java

    r30fefa4 rc455f15b  
    3131    /** list of Destination objects that we point at */
    3232    private final List<I2PSocketAddress> _addrs;
    33     private static final long DEFAULT_READ_TIMEOUT = 5*60*1000; // -1
     33    // application should ping timeout before this
     34    private static final long DEFAULT_READ_TIMEOUT = 10*60*1000;
    3435    protected long readTimeout = DEFAULT_READ_TIMEOUT;
    3536    private final boolean _dccEnabled;
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelIRCServer.java

    r30fefa4 rc455f15b  
    7474    private static final long TOTAL_HEADER_TIMEOUT = 2 * HEADER_TIMEOUT;
    7575    private static final int MAX_LINE_LENGTH = 1024;
     76    // application should ping timeout before this
     77    private static final long DEFAULT_IRC_READ_TIMEOUT = 10*60*1000;
    7678   
    7779    private final static String ERR_UNAVAILABLE =
     
    135137        // get the fake hostmask to use
    136138        this.hostname = opts.getProperty(PROP_HOSTNAME, PROP_HOSTNAME_DEFAULT);
     139        readTimeout = DEFAULT_IRC_READ_TIMEOUT;
    137140    }
    138141   
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelServer.java

    r30fefa4 rc455f15b  
    6363    private I2PSSLSocketFactory _sslFactory;
    6464
    65     private static final long DEFAULT_READ_TIMEOUT = 5*60*1000;
    66     /** default timeout to 5 minutes - override if desired */
     65    private static final long DEFAULT_READ_TIMEOUT = -1;
     66    /** default timeout - override if desired */
    6767    protected long readTimeout = DEFAULT_READ_TIMEOUT;
    6868
     
    372372     * milliseconds).  After this time expires without data being reached from
    373373     * the I2P network, the connection itself will be closed.
     374     *
     375     * Less than or equal to 0 means forever.
     376     * Default -1 (forever) as of 0.9.36 for standard tunnels,
     377     * but extending classes may override.
     378     * Prior to that, default was 5 minutes, but did not work
     379     * due to streaming bugs.
     380     *
     381     * Applies only to future connections;
     382     * calling this does not affect existing connections.
     383     *
     384     * @param ms in ms
    374385     */
    375386    public void setReadTimeout(long ms) {
     
    380391     * Get the read idle timeout for newly-created connections (in
    381392     * milliseconds).
     393     *
     394     * Less than or equal to 0 means forever.
     395     * Default -1 (forever) as of 0.9.36 for standard tunnels,
     396     * but extending classes may override.
     397     * Prior to that, default was 5 minutes, but did not work
     398     * due to streaming bugs.
    382399     *
    383400     * @return The read timeout used for connections
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/irc/I2PTunnelDCCServer.java

    r30fefa4 rc455f15b  
    6565    private static final int MAX_OUTGOING_ACTIVE = 20;
    6666    private static final long OUTBOUND_EXPIRE = 30*60*1000;
     67    private static final long DEFAULT_DCC_READ_TIMEOUT = -1;
     68
    6769    /**
    6870     * There's no support for unsolicited incoming I2P connections,
     
    8082        _resume = new ConcurrentHashMap<Integer, LocalAddress>(8);
    8183        _sockList = new CopyOnWriteArrayList<I2PSocket>();
     84        readTimeout = DEFAULT_DCC_READ_TIMEOUT;
    8285    }
    8386
  • history.txt

    r30fefa4 rc455f15b  
     12018-08-16 zzz
     2 * i2ptunnel: Change read timeout defaults now that streaming timeout works
     3
     42018-08-13 zzz
     5 * Console: Format part. tunnel rate
     6
     72018-08-04 zzz
     8 * Data: Check sooner for unknown sig type
     9 * I2NP: Remove unused Stream methods
     10
     112018-08-03 zzz
     12 * NTCP2: Fix termination handling and padding calculation
     13
    1142018-08-02 zzz
    215 * i2psnark: Don't disconnect seeds if comments enabled (ticket #2288)
  • router/java/src/net/i2p/router/RouterVersion.java

    r30fefa4 rc455f15b  
    1919    public final static String ID = "Monotone";
    2020    public final static String VERSION = CoreVersion.VERSION;
    21     public final static long BUILD = 23;
     21    public final static long BUILD = 24;
    2222
    2323    /** for example "-test" */
Note: See TracChangeset for help on using the changeset viewer.