Author: toad
Date: 2005-12-01 18:52:43 +0000 (Thu, 01 Dec 2005)
New Revision: 7648
Modified:
trunk/freenet/src/freenet/io/comm/UdpSocketManager.java
trunk/freenet/src/freenet/io/xfer/BlockTransmitter.java
trunk/freenet/src/freenet/node/RequestStarter.java
trunk/freenet/src/freenet/node/Version.java
Log:
259: (mandatory)
Mostly logging.
Minor changes to block transmitter.
Modified: trunk/freenet/src/freenet/io/comm/UdpSocketManager.java
===================================================================
--- trunk/freenet/src/freenet/io/comm/UdpSocketManager.java 2005-12-01
17:16:30 UTC (rev 7647)
+++ trunk/freenet/src/freenet/io/comm/UdpSocketManager.java 2005-12-01
18:52:43 UTC (rev 7648)
@@ -219,13 +219,13 @@
i.remove();
f.notify();
}
- Logger.minor(this, "Matched");
+ Logger.minor(this, "Matched: "+f);
break; // Only one match permitted per
message
}
}
}
// Feed unmatched messages to the dispatcher
- if (!matched && (_dispatcher != null)) {
+ if ((!matched) && (_dispatcher != null)) {
try {
Logger.minor(this, "Feeding to dispatcher: "+m);
matched = _dispatcher.handleMessage(m);
@@ -268,13 +268,14 @@
i.remove();
f.notify();
}
+ Logger.minor(this, "Matched:
"+f);
break; // Only one match
permitted per message
}
}
if(!matched) {
while (_unclaimed.size() > 500) {
Message removed =
(Message)_unclaimed.removeFirst();
- Logger.normal(this, "Unclaimed:
"+removed);
+ Logger.normal(this, "Dropping
unclaimed: "+removed);
}
_unclaimed.addLast(m);
}
@@ -320,21 +321,21 @@
Logger.debug(this, "Matching from
_unclaimed");
}
}
- Logger.debug(this, "Not in _unclaimed");
+ Logger.minor(this, "Not in _unclaimed");
if (ret == null) {
// Insert filter into filter list in order of
timeout
ListIterator i = _filters.listIterator();
while (true) {
if (!i.hasNext()) {
i.add(filter);
- Logger.debug(this, "Added at
end");
+ Logger.minor(this, "Added at
end");
break;
}
MessageFilter mf = (MessageFilter)
i.next();
if (mf.getTimeout() >
filter.getTimeout()) {
i.previous();
i.add(filter);
- Logger.debug(this, "Added in
middle - mf timeout="+mf.getTimeout()+" - my timeout="+filter.getTimeout());
+ Logger.minor(this, "Added in
middle - mf timeout="+mf.getTimeout()+" - my timeout="+filter.getTimeout());
break;
}
}
Modified: trunk/freenet/src/freenet/io/xfer/BlockTransmitter.java
===================================================================
--- trunk/freenet/src/freenet/io/xfer/BlockTransmitter.java 2005-12-01
17:16:30 UTC (rev 7647)
+++ trunk/freenet/src/freenet/io/xfer/BlockTransmitter.java 2005-12-01
18:52:43 UTC (rev 7648)
@@ -118,7 +118,8 @@
// No
unsent packets
if(getNumSent() == _prb.getNumPackets()) {
Logger.minor(this, "Sent all blocks, none unsent");
-
timeAllSent = System.currentTimeMillis();
+
if(timeAllSent <= 0)
+
timeAllSent = System.currentTimeMillis();
}
}
if(_sendComplete) return;
@@ -126,6 +127,7 @@
_senderThread.wait(10*1000);
}
}
+ timeAllSent = -1;
} catch (InterruptedException
e) {
} catch (AbortedException e) {
synchronized(_senderThread) {
@@ -288,7 +290,11 @@
}
Message msg;
try {
- msg =
_usm.waitFor(MessageFilter.create().setTimeout(SEND_TIMEOUT).setType(DMT.missingPacketNotification).setField(DMT.UID,
_uid).or(MessageFilter.create().setType(DMT.allReceived).setField(DMT.UID,
_uid).setTimeout(SEND_TIMEOUT)).or(MessageFilter.create().setType(DMT.sendAborted).setField(DMT.UID,
_uid).setTimeout(SEND_TIMEOUT)));
+ MessageFilter mf =
+
MessageFilter.create().setType(DMT.missingPacketNotification).setField(DMT.UID,
_uid).setTimeout(SEND_TIMEOUT).setSource(_destination).
+
or(MessageFilter.create().setType(DMT.allReceived).setField(DMT.UID,
_uid).setTimeout(SEND_TIMEOUT).setSource(_destination)).
+
or(MessageFilter.create().setType(DMT.sendAborted).setField(DMT.UID,
_uid).setTimeout(SEND_TIMEOUT).setSource(_destination));
+ msg = _usm.waitFor(mf);
} catch (DisconnectedException e) {
// Ignore, see below
msg = null;
Modified: trunk/freenet/src/freenet/node/RequestStarter.java
===================================================================
--- trunk/freenet/src/freenet/node/RequestStarter.java 2005-12-01 17:16:30 UTC
(rev 7647)
+++ trunk/freenet/src/freenet/node/RequestStarter.java 2005-12-01 18:52:43 UTC
(rev 7648)
@@ -57,7 +57,7 @@
cycleNumber = 0;
this.throttle = throttle;
this.name = name;
- Thread t = new Thread(this, "Request starter");
+ Thread t = new Thread(this, name);
t.setDaemon(true);
t.start();
}
Modified: trunk/freenet/src/freenet/node/Version.java
===================================================================
--- trunk/freenet/src/freenet/node/Version.java 2005-12-01 17:16:30 UTC (rev
7647)
+++ trunk/freenet/src/freenet/node/Version.java 2005-12-01 18:52:43 UTC (rev
7648)
@@ -20,10 +20,10 @@
public static final String protocolVersion = "1.0";
/** The build number of the current revision */
- public static final int buildNumber = 258;
+ public static final int buildNumber = 259;
/** Oldest build of Fred we will talk to */
- public static final int lastGoodBuild = 258;
+ public static final int lastGoodBuild = 259;
/** The highest reported build of fred */
public static int highestSeenBuild = buildNumber;