* if we send a blank ACK message (that will not in turn be ACKed) and it

has session tags within it, send an additional ping to the peer,
  bundling those tags a second time, ACKing those tags on the pong.
* handle packets transferred during a race after the receiver ACKs the
  connection but before the establisher receives the ACK.
* notify the messageInputStream reader on close (duh)
* new stream sink test, shoving lots and lots of data down a stream
  with the existing StreamSinkServer and StreamSinkClient apps
* logging
This commit is contained in:
jrandom
2004-10-24 23:23:35 +00:00
committed by zzz
parent 9680effb9f
commit 8de41acfe1
15 changed files with 248 additions and 66 deletions

View File

@@ -35,8 +35,12 @@ class PacketQueue {
else
size = packet.writePacket(_buf, 0);
SessionKey keyUsed = new SessionKey();
Set tagsSent = new HashSet();
SessionKey keyUsed = packet.getKeyUsed();
if (keyUsed == null)
keyUsed = new SessionKey();
Set tagsSent = packet.getTagsSent();
if (tagsSent == null)
tagsSent = new HashSet();
try {
// this should not block!
boolean sent = _session.sendMessage(packet.getTo(), _buf, 0, size, keyUsed, tagsSent);
@@ -47,6 +51,13 @@ class PacketQueue {
packet.setKeyUsed(keyUsed);
packet.setTagsSent(tagsSent);
packet.incrementSends();
if (_log.shouldLog(Log.DEBUG)) {
String msg = packet + " sent" + (tagsSent.size() > 0
? " with " + tagsSent.size() + " tags"
: "")
+ " send # " + packet.getNumSends();
_log.debug(msg);
}
}
} catch (I2PSessionException ise) {
if (_log.shouldLog(Log.WARN))