[freenet-cvs] r16187 - trunk/freenet/src/freenet/node

toad at freenetproject.org toad at freenetproject.org
Sat Dec 1 16:57:29 UTC 2007


Author: toad
Date: 2007-12-01 16:57:29 +0000 (Sat, 01 Dec 2007)
New Revision: 16187

Modified:
   trunk/freenet/src/freenet/node/OpennetManager.java
Log:
Refactor the actual sending into another method

Modified: trunk/freenet/src/freenet/node/OpennetManager.java
===================================================================
--- trunk/freenet/src/freenet/node/OpennetManager.java	2007-12-01 16:56:29 UTC (rev 16186)
+++ trunk/freenet/src/freenet/node/OpennetManager.java	2007-12-01 16:57:29 UTC (rev 16187)
@@ -478,6 +478,18 @@
 		Message msg2 = isReply ? DMT.createFNPOpennetConnectReplyNew(uid, xferUID, noderef.length, padded.length) :
 			DMT.createFNPOpennetConnectDestinationNew(uid, xferUID, noderef.length, padded.length);
 		peer.sendAsync(msg2, null, 0, ctr);
+		innerSendOpennetRef(xferUID, padded, peer);
+	}
+
+	/**
+	 * Just the actual transfer.
+	 * @param xferUID The transfer UID
+	 * @param padded The length of the data to transfer.
+	 * @param peer The peer to send it to.
+	 * @throws NotConnectedException If the peer is not connected, or we lose the connection to the peer,
+	 * or it restarts.
+	 */
+	private void innerSendOpennetRef(long xferUID, byte[] padded, PeerNode peer) throws NotConnectedException {
 		ByteArrayRandomAccessThing raf = new ByteArrayRandomAccessThing(padded);
 		raf.setReadOnly();
 		PartiallyReceivedBulk prb =




More information about the cvs mailing list