Author: toad
Date: 2005-12-06 16:20:58 +0000 (Tue, 06 Dec 2005)
New Revision: 7682
Modified:
trunk/freenet/src/freenet/node/PacketSender.java
trunk/freenet/src/freenet/node/PeerNode.java
trunk/freenet/src/freenet/node/Version.java
Log:
281: (mandatory)
sendAnyUrgentNotifications _can_ throw PacketSequenceException.
Modified: trunk/freenet/src/freenet/node/PacketSender.java
===================================================================
--- trunk/freenet/src/freenet/node/PacketSender.java 2005-12-06 16:19:14 UTC
(rev 7681)
+++ trunk/freenet/src/freenet/node/PacketSender.java 2005-12-06 16:20:58 UTC
(rev 7682)
@@ -64,7 +64,12 @@
long urgentTime = pn.getNextUrgentTime();
if(urgentTime <= now) {
// Send them
- pn.sendAnyUrgentNotifications();
+ try {
+ pn.sendAnyUrgentNotifications();
+ } catch (PacketSequenceException e) {
+ Logger.error(this, "Caught "+e+" - disconnecting", e);
+ pn.forceDisconnect();
+ }
} else {
nextActionTime = Math.min(nextActionTime, urgentTime);
}
Modified: trunk/freenet/src/freenet/node/PeerNode.java
===================================================================
--- trunk/freenet/src/freenet/node/PeerNode.java 2005-12-06 16:19:14 UTC
(rev 7681)
+++ trunk/freenet/src/freenet/node/PeerNode.java 2005-12-06 16:20:58 UTC
(rev 7682)
@@ -799,9 +799,10 @@
/**
* Send a payload-less packet on either key if necessary.
- * @throws PacketSequenceException
+ * @throws PacketSequenceException If there is an error sending the packet
+ * caused by a sequence inconsistency.
*/
- public void sendAnyUrgentNotifications() {
+ public void sendAnyUrgentNotifications() throws PacketSequenceException {
Logger.minor(this, "sendAnyUrgentNotifications");
long now = System.currentTimeMillis();
KeyTracker cur, prev;
@@ -819,8 +820,6 @@
// Ignore
} catch (KeyChangedException e) {
// Ignore
- } catch (PacketSequenceException e) {
- Logger.error(this, "Impossible: "+e, e);
} catch (WouldBlockException e) {
// TODO Auto-generated catch block
e.printStackTrace();
@@ -839,8 +838,6 @@
// Ignore
} catch (WouldBlockException e) {
Logger.error(this, "Impossible: "+e, e);
- } catch (PacketSequenceException e) {
- Logger.error(this, "Impossible: "+e, e);
}
}
}
Modified: trunk/freenet/src/freenet/node/Version.java
===================================================================
--- trunk/freenet/src/freenet/node/Version.java 2005-12-06 16:19:14 UTC (rev
7681)
+++ trunk/freenet/src/freenet/node/Version.java 2005-12-06 16:20:58 UTC (rev
7682)
@@ -20,10 +20,10 @@
public static final String protocolVersion = "1.0";
/** The build number of the current revision */
- public static final int buildNumber = 280;
+ public static final int buildNumber = 281;
/** Oldest build of Fred we will talk to */
- public static final int lastGoodBuild = 280;
+ public static final int lastGoodBuild = 281;
/** The highest reported build of fred */
public static int highestSeenBuild = buildNumber;