Author: toad Date: 2006-11-24 23:05:40 +0000 (Fri, 24 Nov 2006) New Revision: 11042
Modified:
trunk/freenet/src/freenet/io/xfer/BlockTransmitter.java
Log:
Minor indent fix.
Modified: trunk/freenet/src/freenet/io/xfer/BlockTransmitter.java
===================================================================
--- trunk/freenet/src/freenet/io/xfer/BlockTransmitter.java 2006-11-24
19:36:57 UTC (rev 11041)
+++ trunk/freenet/src/freenet/io/xfer/BlockTransmitter.java 2006-11-24
23:05:40 UTC (rev 11042)
@@ -80,59 +80,59 @@
public void run() {
while (!_sendComplete) {
- long startCycleTime =
System.currentTimeMillis();
- try {
- while (true) {
-
synchronized(_senderThread) {
-
if(_unsent.size() != 0) break;
- // No
unsent packets
-
if(getNumSent() == _prb.getNumPackets()) {
-
if(Logger.shouldLog(Logger.MINOR, this))
-
Logger.minor(this, "Sent all blocks, none unsent");
-
if(timeAllSent <= 0)
-
timeAllSent = System.currentTimeMillis();
- }
-
if(_sendComplete) return;
-
_senderThread.wait(10*1000);
+ long startCycleTime =
System.currentTimeMillis();
+ try {
+ while (true) {
+
synchronized(_senderThread) {
+
if(_unsent.size() != 0) break;
+ // No unsent
packets
+ if(getNumSent()
== _prb.getNumPackets()) {
+
if(Logger.shouldLog(Logger.MINOR, this))
+
Logger.minor(this, "Sent all blocks, none unsent");
+
if(timeAllSent <= 0)
+
timeAllSent = System.currentTimeMillis();
}
+
if(_sendComplete) return;
+
_senderThread.wait(10*1000);
}
- timeAllSent = -1;
- } catch (InterruptedException
e) {
- } catch (AbortedException e) {
-
synchronized(_senderThread) {
- _sendComplete =
true;
-
_senderThread.notifyAll();
- }
- return;
}
- int packetNo;
- try {
-
synchronized(_senderThread) {
- packetNo =
((Integer) _unsent.removeFirst()).intValue();
- }
- } catch (NoSuchElementException
nsee) {
- // back up to the top
to check for completion
- continue;
+ timeAllSent = -1;
+ } catch (InterruptedException e) {
+ } catch (AbortedException e) {
+ synchronized(_senderThread) {
+ _sendComplete = true;
+
_senderThread.notifyAll();
}
- delay(startCycleTime);
- if(_sendComplete) break;
- _sentPackets.setBit(packetNo,
true);
- try {
-
((PeerNode)_destination).sendAsync(DMT.createPacketTransmit(_uid, packetNo,
_sentPackets, _prb.getPacket(packetNo)), null, PACKET_SIZE, _ctr);
-
_ctr.sentPayload(PACKET_SIZE);
- } catch (NotConnectedException
e) {
- Logger.normal(this,
"Terminating send: "+e);
-
synchronized(_senderThread) {
- _sendComplete =
true;
-
_senderThread.notifyAll();
- }
- } catch (AbortedException e) {
- Logger.normal(this,
"Terminating send due to abort: "+e);
-
synchronized(_senderThread) {
- _sendComplete =
true;
-
_senderThread.notifyAll();
- }
+ return;
+ }
+ int packetNo;
+ try {
+ synchronized(_senderThread) {
+ packetNo = ((Integer)
_unsent.removeFirst()).intValue();
}
+ } catch (NoSuchElementException nsee) {
+ // back up to the top to check
for completion
+ continue;
+ }
+ delay(startCycleTime);
+ if(_sendComplete) break;
+ _sentPackets.setBit(packetNo, true);
+ try {
+
((PeerNode)_destination).sendAsync(DMT.createPacketTransmit(_uid, packetNo,
_sentPackets, _prb.getPacket(packetNo)), null, PACKET_SIZE, _ctr);
+ _ctr.sentPayload(PACKET_SIZE);
+ } catch (NotConnectedException e) {
+ Logger.normal(this,
"Terminating send: "+e);
+ synchronized(_senderThread) {
+ _sendComplete = true;
+
_senderThread.notifyAll();
+ }
+ } catch (AbortedException e) {
+ Logger.normal(this,
"Terminating send due to abort: "+e);
+ synchronized(_senderThread) {
+ _sendComplete = true;
+
_senderThread.notifyAll();
+ }
+ }
}
}
