forked from I2P_Developers/i2p.i2p
2005-10-07 jrandom
* Allow the I2PTunnelHTTPServer to send back the first few packets of an
HTTP response quicker, and initialize the streaming lib's cwin more
carefully.
* Added a small web UI to the new Syndie scheduled updater. If you log in
as a user authorized to use the remote archive funtionality, you can
request remote archives in your address book to be automatically pulled
down by checking the "scheduled?" checkbox.
This commit is contained in:
@@ -102,7 +102,7 @@ public class Connection {
|
||||
_closeSentOn = -1;
|
||||
_closeReceivedOn = -1;
|
||||
_unackedPacketsReceived = 0;
|
||||
_congestionWindowEnd = 0;
|
||||
_congestionWindowEnd = _options.getWindowSize()-1;
|
||||
_highestAckedThrough = -1;
|
||||
_lastCongestionSeenAt = MAX_WINDOW_SIZE*2; // lets allow it to grow
|
||||
_lastCongestionTime = -1;
|
||||
@@ -153,8 +153,12 @@ public class Connection {
|
||||
synchronized (_outboundPackets) {
|
||||
if (!started)
|
||||
_context.statManager().addRateData("stream.chokeSizeBegin", _outboundPackets.size(), timeoutMs);
|
||||
if (!_connected)
|
||||
return false;
|
||||
|
||||
// no need to wait until the other side has ACKed us before sending the first few wsize
|
||||
// packets through
|
||||
// if (!_connected)
|
||||
// return false;
|
||||
|
||||
started = true;
|
||||
if ( (_outboundPackets.size() >= _options.getWindowSize()) || (_activeResends > 0) ||
|
||||
(_lastSendId - _highestAckedThrough > _options.getWindowSize()) ) {
|
||||
|
||||
@@ -163,9 +163,20 @@ public class PacketHandler {
|
||||
if ( (con.getSendStreamId() <= 0) ||
|
||||
(DataHelper.eq(con.getSendStreamId(), packet.getReceiveStreamId())) ||
|
||||
(packet.getSequenceNum() <= 5) ) { // its in flight from the first batch
|
||||
long oldId =con.getSendStreamId();
|
||||
if (packet.isFlagSet(Packet.FLAG_SYNCHRONIZE)) // con fully established, w00t
|
||||
con.setSendStreamId(packet.getReceiveStreamId());
|
||||
long oldId = con.getSendStreamId();
|
||||
if (packet.isFlagSet(Packet.FLAG_SYNCHRONIZE)) {
|
||||
if (oldId <= 0) {
|
||||
// con fully established, w00t
|
||||
con.setSendStreamId(packet.getReceiveStreamId());
|
||||
} else if (oldId == packet.getReceiveStreamId()) {
|
||||
// ok, as expected...
|
||||
} else {
|
||||
if (_log.shouldLog(Log.ERROR))
|
||||
_log.error("Received a syn with the wrong IDs, con=" + con + " packet=" + packet);
|
||||
packet.releasePayload();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
con.getPacketHandler().receivePacket(packet, con);
|
||||
|
||||
Reference in New Issue
Block a user