Update of /cvsroot/freenet/freenet/src/freenet/node/states/data
In directory sc8-pr-cvs1:/tmp/cvs-serv16753/src/freenet/node/states/data
Modified Files:
SendData.java
Log Message:
6224:
More debugging of PeerHandler and supporting microarchitectural changes.
- Splitfile fetch between 2 test nodes works again, rather than failing with RNFs.
- Fix totalDataSent i.e. fix OCM's report of total data sent on a conn
- Encrypt data at send time. Not in advance in packet.
- Locking changes.
- Add hasTrailer() to Message. Implement it on all Messages.
- Make a distinction between needsConnection as in can we route to it, or do we want a
new connection if possible.
- Keep separate queues for messages with and without trailers in PeerHandler.
- Messages without trailers take priority.
- needConnection(true) returns false if we have no messages queued and no trailers
sending and we are not in the RT.
- Remove closed conns from the PeerHandler when we find them. They will still be in
the OCM.
- SendData: Count size of padding sent the same way we count the non-padding - don't
add it on and therefore don't finish until after we have sent it.
Add a TODO about the data: protocol
- Cancel outwardSender callback in Pending after we get Accepted. We may have a bug
causing notifications to be lost.
- Fix possible NPE in FnpLink.encryptBytes.
Logging
Also some fixes and optimizations since 6223 by other people.
Index: SendData.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/node/states/data/SendData.java,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- SendData.java 7 Oct 2003 00:47:30 -0000 1.22
+++ SendData.java 8 Oct 2003 22:54:18 -0000 1.23
@@ -164,7 +164,10 @@
if(handleThrowable(null, true) == null)
return null;
} else {
- moved += lastPacketLength;
+ if(inPaddingMode)
+ sentPadding += lastPacketLength;
+ else
+ moved += lastPacketLength;
}
}
@@ -328,13 +331,13 @@
stuffToSend[stuffToSend.length-1] = (byte)
((result == Presentation.CB_ABORTED) ?
Presentation.CB_ABORTED : Presentation.CB_RESTARTED);
- sentPadding = paddingLength;
+ lastPacketLength = stuffToSend.length;
} else {
// Just another chunk
stuffToSend = new byte[Core.blockSize];
Random r = new Random(Core.randSource.nextLong());
r.nextBytes(stuffToSend); // is this necessary? it used to be 0 padded
- sentPadding += Core.blockSize;
+ lastPacketLength = Core.blockSize;
}
myTWCM.reset();
waitingForWriteNotify = true;
_______________________________________________
cvs mailing list
[EMAIL PROTECTED]
http://dodo.freenetproject.org/cgi-bin/mailman/listinfo/cvs