* NetDB: Reduce negative lookup cache time

* OCMOSJ:
   - Increase timeout if we must lookup leaseset
 * Streaming:
   - Shorter expire time in TCBCache
   - Don't fail a connection once it is up
   - Log tweaks
This commit is contained in:
zzz
2014-06-07 13:23:38 +00:00
parent d328e78727
commit 40e5bcbdbb
6 changed files with 58 additions and 30 deletions

View File

@@ -281,27 +281,36 @@ class PacketQueue implements SendMessageStatusListener {
case MessageStatusMessage.STATUS_SEND_FAILURE_EXPIRED_LEASESET:
case MessageStatusMessage.STATUS_SEND_FAILURE_NO_LEASESET:
case SendMessageStatusListener.STATUS_CANCELLED:
if (_log.shouldLog(Log.WARN))
_log.warn("Rcvd hard failure status " + status + " for msg " + msgId + " on " + con);
_messageStatusMap.remove(id);
IOException ioe = new I2PSocketException(status);
con.getOutputStream().streamErrorOccurred(ioe);
con.getInputStream().streamErrorOccurred(ioe);
con.setConnectionError("failure code " + status);
con.disconnect(false);
if (con.getHighestAckedThrough() >= 0) {
// a retxed SYN succeeded before the first SYN failed
if (_log.shouldLog(Log.WARN))
_log.warn("Rcvd hard failure but already connected, status " + status + " for msg " + msgId + " on " + con);
} else if (!con.getIsConnected()) {
if (_log.shouldLog(Log.WARN))
_log.warn("Rcvd hard failure but already closed, status " + status + " for msg " + msgId + " on " + con);
} else {
if (_log.shouldLog(Log.WARN))
_log.warn("Rcvd hard failure status " + status + " for msg " + msgId + " on " + con);
_messageStatusMap.remove(id);
IOException ioe = new I2PSocketException(status);
con.getOutputStream().streamErrorOccurred(ioe);
con.getInputStream().streamErrorOccurred(ioe);
con.setConnectionError("failure code " + status);
con.disconnect(false);
}
break;
case MessageStatusMessage.STATUS_SEND_BEST_EFFORT_SUCCESS:
case MessageStatusMessage.STATUS_SEND_GUARANTEED_SUCCESS:
case MessageStatusMessage.STATUS_SEND_SUCCESS_LOCAL:
if (_log.shouldLog(Log.WARN))
_log.warn("Rcvd success status " + status + " for msg " + msgId + " on " + con);
if (_log.shouldLog(Log.INFO))
_log.info("Rcvd success status " + status + " for msg " + msgId + " on " + con);
_messageStatusMap.remove(id);
break;
case MessageStatusMessage.STATUS_SEND_ACCEPTED:
if (_log.shouldLog(Log.WARN))
_log.warn("Rcvd accept status " + status + " for msg " + msgId + " on " + con);
if (_log.shouldLog(Log.INFO))
_log.info("Rcvd accept status " + status + " for msg " + msgId + " on " + con);
break;
default:

View File

@@ -29,8 +29,8 @@ class TCBShare {
private final CleanEvent _cleaner;
private final double _rttDampening, _wdwDampening, _rttDevDampening;
private static final long EXPIRE_TIME = 30*60*1000;
private static final long CLEAN_TIME = 10*60*1000;
private static final long EXPIRE_TIME = 15*60*1000;
private static final long CLEAN_TIME = 5*60*1000;
///// constants defined in rfc 2140
///// do not change unless you know what you're doing
private static final double RTT_DAMPENING = 0.75;