Author: toad
Date: 2008-03-20 22:36:22 +0000 (Thu, 20 Mar 2008)
New Revision: 18670
Modified:
trunk/freenet/src/freenet/io/xfer/BlockTransmitter.java
trunk/freenet/src/freenet/io/xfer/BulkTransmitter.java
trunk/freenet/src/freenet/io/xfer/PacketThrottle.java
Log:
ctr cannot be null
Modified: trunk/freenet/src/freenet/io/xfer/BlockTransmitter.java
===================================================================
--- trunk/freenet/src/freenet/io/xfer/BlockTransmitter.java 2008-03-20
22:35:13 UTC (rev 18669)
+++ trunk/freenet/src/freenet/io/xfer/BlockTransmitter.java 2008-03-20
22:36:22 UTC (rev 18670)
@@ -69,6 +69,7 @@
_uid = uid;
_prb = source;
_ctr = ctr;
+ if(_ctr == null) throw new NullPointerException();
PACKET_SIZE = DMT.packetTransmitSize(_prb._packetSize,
_prb._packets)
+
destination.getOutgoingMangler().fullHeadersLengthOneMessage();
try {
Modified: trunk/freenet/src/freenet/io/xfer/BulkTransmitter.java
===================================================================
--- trunk/freenet/src/freenet/io/xfer/BulkTransmitter.java 2008-03-20
22:35:13 UTC (rev 18669)
+++ trunk/freenet/src/freenet/io/xfer/BulkTransmitter.java 2008-03-20
22:36:22 UTC (rev 18670)
@@ -62,6 +62,7 @@
this.uid = uid;
this.noWait = noWait;
this.ctr = ctr;
+ if(ctr == null) throw new NullPointerException();
peerBootID = peer.getBootID();
// Need to sync on prb while doing both operations, to avoid
race condition.
// Specifically, we must not get calls to blockReceived() until
blocksNotSentButPresent
Modified: trunk/freenet/src/freenet/io/xfer/PacketThrottle.java
===================================================================
--- trunk/freenet/src/freenet/io/xfer/PacketThrottle.java 2008-03-20
22:35:13 UTC (rev 18669)
+++ trunk/freenet/src/freenet/io/xfer/PacketThrottle.java 2008-03-20
22:36:22 UTC (rev 18670)
@@ -221,7 +221,7 @@
} else if(logMINOR)
Logger.minor(this, "Not throttling
"+peer.shortToString()+" for "+this);
peer.sendAsync(msg, callback, packetSize, ctr);
- if(ctr != null) ctr.sentPayload(packetSize);
+ ctr.sentPayload(packetSize);
} catch (RuntimeException e) {
callback.fatalError();
throw e;