I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 9690a89a authored by jrandom's avatar jrandom Committed by zzz
Browse files

sliices are only too slow if there's something pending

logging mods
i really need to rewrite the tcp transport - the code is all functional, but the design sucks.
with the FIFO bandwidth limiter we could get away with a single 'send' thread rather than each TCPConnection having its own writer thread (but we'd still need the per-con reader thread, at least until nio is solid enough)
but maybe the rewrite can hold off until the AMOC implementation.  we'll see
parent 8f895f43
No related branches found
No related tags found
No related merge requests found
......@@ -423,7 +423,15 @@ class TCPConnection implements I2NPMessageReader.I2NPMessageEventListener {
*/
private boolean slicesTooLong() {
if (_lastSliceRun <= 0) return false;
synchronized (_toBeSent) {
// if there's nothing pending, dont worry about it
if (_toBeSent.size() <= 0)
return false;
}
long diff = _context.clock().now() - _lastSliceRun;
boolean tooLong = diff > MAX_SLICE_DURATION;
if (tooLong)
_log.warn("Slices are taking " + diff + "ms");
return (diff > MAX_SLICE_DURATION);
}
......@@ -542,7 +550,7 @@ class TCPConnection implements I2NPMessageReader.I2NPMessageEventListener {
+ " bytes in " + (end - afterExpire) + "ms (write took "
+ (end - beforeWrite) + "ms, prepare took "
+ (beforeWrite - afterExpire) + "ms)");
if (timeLeft < 10*1000) {
if (timeLeft < 2*1000) {
if (_log.shouldLog(Log.DEBUG))
_log.warn("Very little time left... time to send [" + (end-start)
+ "] time left [" + timeLeft + "] to "
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment