* Cache DNS and negative DNS for 5m (was 1m and forever)

* Delay shitlist cleaner at startup
    * Strip wrapper properties from client config
    * Define multiple cert type
    * Prohibit negative maxSends in streaming
    * HTML fixup on configtunnels.jsp
    * Increase wrapper exit timeout from default 15s to 30s
This commit is contained in:
zzz
2008-11-21 16:29:16 +00:00
parent 93f0092437
commit 4e5825c648
10 changed files with 53 additions and 29 deletions

View File

@ -28,11 +28,16 @@ class ConnectionDataReceiver implements MessageOutputStream.DataReceiver {
/**
* This tells the flusher in MessageOutputStream whether to flush.
* It won't flush if this returns true.
* It was: return con.getUnackedPacketsSent() > 0;
*
* It was: return con.getUnackedPacketsSent() > 0 (i.e. Nagle)
* But then, for data that fills more than one packet, the last part of
* the data isn't sent until all the previous packets are acked. Which is very slow.
* The poor interaction of Nagle and Delayed Acknowledgements is well-documented.
*
* So let's send data along unless the outbound window is full.
* (i.e. no-Nagle or TCP_NODELAY)
*
* Probably should have a configuration option for this.
*
* @return !flush
*/

View File

@ -56,7 +56,7 @@ public class ConnectionOptions extends I2PSocketOptionsImpl {
private static final int TREND_COUNT = 3;
static final int INITIAL_WINDOW_SIZE = 12;
static final int DEFAULT_MAX_SENDS = 8;
public static final int DEFAULT_INITIAL_RTT = 10*1000;
static final int MIN_WINDOW_SIZE = 1;
/**
@ -208,7 +208,7 @@ public class ConnectionOptions extends I2PSocketOptionsImpl {
setConnectDelay(getInt(opts, PROP_CONNECT_DELAY, -1));
setProfile(getInt(opts, PROP_PROFILE, PROFILE_BULK));
setMaxMessageSize(getInt(opts, PROP_MAX_MESSAGE_SIZE, DEFAULT_MAX_MESSAGE_SIZE));
setRTT(getInt(opts, PROP_INITIAL_RTT, 10*1000));
setRTT(getInt(opts, PROP_INITIAL_RTT, DEFAULT_INITIAL_RTT));
setReceiveWindow(getInt(opts, PROP_INITIAL_RECEIVE_WINDOW, 1));
setResendDelay(getInt(opts, PROP_INITIAL_RESEND_DELAY, 1000));
setSendAckDelay(getInt(opts, PROP_INITIAL_ACK_DELAY, 2000));
@ -237,7 +237,7 @@ public class ConnectionOptions extends I2PSocketOptionsImpl {
if (opts.containsKey(PROP_MAX_MESSAGE_SIZE))
setMaxMessageSize(getInt(opts, PROP_MAX_MESSAGE_SIZE, Packet.MAX_PAYLOAD_SIZE));
if (opts.containsKey(PROP_INITIAL_RTT))
setRTT(getInt(opts, PROP_INITIAL_RTT, 10*1000));
setRTT(getInt(opts, PROP_INITIAL_RTT, DEFAULT_INITIAL_RTT));
if (opts.containsKey(PROP_INITIAL_RECEIVE_WINDOW))
setReceiveWindow(getInt(opts, PROP_INITIAL_RECEIVE_WINDOW, 1));
if (opts.containsKey(PROP_INITIAL_RESEND_DELAY))
@ -306,6 +306,7 @@ public class ConnectionOptions extends I2PSocketOptionsImpl {
}
/** after how many consecutive messages should we ack?
* This doesn't appear to be used.
* @return receive window size.
*/
public int getReceiveWindow() { return _receiveWindow; }
@ -420,7 +421,7 @@ public class ConnectionOptions extends I2PSocketOptionsImpl {
* @return Maximum retrys before failing a sent message.
*/
public int getMaxResends() { return _maxResends; }
public void setMaxResends(int numSends) { _maxResends = numSends; }
public void setMaxResends(int numSends) { _maxResends = Math.max(numSends, 0); }
/**
* What period of inactivity qualifies as "too long"?

View File

@ -38,7 +38,7 @@ import net.i2p.util.Log;
* <li>{@link #FLAG_SIGNATURE_INCLUDED}: {@link net.i2p.data.Signature}</li>
* <li>{@link #FLAG_SIGNATURE_REQUESTED}: no option data</li>
* <li>{@link #FLAG_FROM_INCLUDED}: {@link net.i2p.data.Destination}</li>
* <li>{@link #FLAG_DELAY_REQUESTED}: 1 byte integer</li>
* <li>{@link #FLAG_DELAY_REQUESTED}: 2 byte integer</li>
* <li>{@link #FLAG_MAX_PACKET_SIZE_INCLUDED}: 2 byte integer</li>
* <li>{@link #FLAG_PROFILE_INTERACTIVE}: no option data</li>
* </ol>