forked from I2P_Developers/i2p.i2p
2005-04-24 jrandom
* Added a pool of PRNGs using a different synchronization technique, hopefully sufficient to work around IBM's PRNG bugs until we get our own Fortuna. * In the streaming lib, don't jack up the RTT on NACK, and have the window size bound the not-yet-ready messages to the peer, not the unacked message count (not sure yet whether this is worthwile). * Many additions to the messageHistory log. * Handle out of order tunnel fragment delivery (not an issue on the live net with TCP, but critical with UDP). and for udp stuff: * implemented tcp-esque rto code in the udp transport * make sure we don't ACK too many messages at once * transmit fragments in a simple (nonrandom) order so that we can more easily adjust timeouts/etc. * let the active outbound pool grow dynamically if there are outbound slots to spare * use a simple decaying bloom filter at the UDP level to drop duplicate resent packets.
This commit is contained in:
@ -152,7 +152,8 @@ public class Connection {
|
||||
if (!_connected)
|
||||
return false;
|
||||
started = true;
|
||||
if ( (_outboundPackets.size() >= _options.getWindowSize()) || (_activeResends > 0) ) {
|
||||
if ( (_outboundPackets.size() >= _options.getWindowSize()) || (_activeResends > 0) ||
|
||||
(_lastSendId - _highestAckedThrough > _options.getWindowSize()) ) {
|
||||
if (writeExpire > 0) {
|
||||
if (timeLeft <= 0) {
|
||||
_log.error("Outbound window is full of " + _outboundPackets.size()
|
||||
|
@ -167,11 +167,14 @@ public class ConnectionPacketHandler {
|
||||
// non-ack message payloads are queued in the MessageInputStream
|
||||
packet.releasePayload();
|
||||
}
|
||||
|
||||
//if (choke)
|
||||
// con.fastRetransmit();
|
||||
}
|
||||
|
||||
private boolean ack(Connection con, long ackThrough, long nacks[], Packet packet, boolean isNew, boolean choke) {
|
||||
if ( (nacks != null) && (nacks.length > 0) )
|
||||
con.getOptions().setRTT(con.getOptions().getRTT() + nacks.length*1000);
|
||||
//if ( (nacks != null) && (nacks.length > 0) )
|
||||
// con.getOptions().setRTT(con.getOptions().getRTT() + nacks.length*1000);
|
||||
|
||||
int numResends = 0;
|
||||
List acked = con.ackPackets(ackThrough, nacks);
|
||||
|
Reference in New Issue
Block a user