diff --git a/apps/routerconsole/java/build.xml b/apps/routerconsole/java/build.xml
index 747874ef4..3db3038ea 100644
--- a/apps/routerconsole/java/build.xml
+++ b/apps/routerconsole/java/build.xml
@@ -89,6 +89,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
$TMPFILE
+ if [ "$POUPDATE" = "1" ]
+ then
+ # make list of java files newer than the .po file
+ find $JPATHS -name *.java -newer $i > $TMPFILE
+ fi
+
if [ -s build/obj/net/i2p/router/web/messages_$LG.class -a \
build/obj/net/i2p/router/web/messages_$LG.class -nt $i -a \
! -s $TMPFILE ]
@@ -46,42 +60,46 @@ do
continue
fi
- echo "Generating ${CLASS}_$LG ResourceBundle..."
+ if [ "$POUPDATE" = "1" ]
+ then
+ echo "Updating the $i file from the tags..."
+ # extract strings from java and jsp files, and update messages.po files
+ # translate calls must be one of the forms:
+ # _("foo")
+ # _x("foo")
+ # intl._("foo")
+ # intl.title("foo")
+ # handler._("foo")
+ # formhandler._("foo")
+ # net.i2p.router.web.Messages.getString("foo")
+ # In a jsp, you must use a helper or handler that has the context set.
+ # To start a new translation, copy the header from an old translation to the new .po file,
+ # then ant distclean updater.
+ find $JPATHS -name *.java > $TMPFILE
+ xgettext -f $TMPFILE -F -L java --from-code=UTF-8 \
+ --keyword=_ --keyword=_x --keyword=intl._ --keyword=intl.title \
+ --keyword=handler._ --keyword=formhandler._ \
+ --keyword=net.i2p.router.web.Messages.getString \
+ -o ${i}t
+ if [ $? -ne 0 ]
+ then
+ echo 'Warning - xgettext failed, not updating translations'
+ rm -f ${i}t
+ break
+ fi
+ msgmerge -U --backup=none $i ${i}t
+ if [ $? -ne 0 ]
+ then
+ echo 'Warning - msgmerge failed, not updating translations'
+ rm -f ${i}t
+ break
+ fi
+ rm -f ${i}t
+ # so we don't do this again
+ touch $i
+ fi
- # extract strings from java and jsp files, and update messages.po files
- # translate calls must be one of the forms:
- # _("foo")
- # _x("foo")
- # intl._("foo")
- # intl.title("foo")
- # handler._("foo")
- # formhandler._("foo")
- # net.i2p.router.web.Messages.getString("foo")
- # In a jsp, you must use a helper or handler that has the context set.
- # To start a new translation, copy the header from an old translation to the new .po file,
- # then ant distclean updater.
- find $JPATHS -name *.java > $TMPFILE
- xgettext -f $TMPFILE -F -L java --from-code=UTF-8 \
- --keyword=_ --keyword=_x --keyword=intl._ --keyword=intl.title \
- --keyword=handler._ --keyword=formhandler._ \
- --keyword=net.i2p.router.web.Messages.getString \
- -o ${i}t
- if [ $? -ne 0 ]
- then
- echo 'Warning - xgettext failed, not updating translations'
- rm -f ${i}t
- break
- fi
- msgmerge -U --backup=none $i ${i}t
- if [ $? -ne 0 ]
- then
- echo 'Warning - msgmerge failed, not updating translations'
- rm -f ${i}t
- break
- fi
- rm -f ${i}t
- # so we don't do this again
- touch $i
+ echo "Generating ${CLASS}_$LG ResourceBundle..."
# convert to class files in build/obj
msgfmt --java -r $CLASS -l $LG -d build/obj $i
diff --git a/build.xml b/build.xml
index 4ea82687d..f2e27b1df 100644
--- a/build.xml
+++ b/build.xml
@@ -32,6 +32,7 @@
+
@@ -138,6 +139,9 @@
+
+
+
diff --git a/history.txt b/history.txt
index cfdeb9852..45ede2a7d 100644
--- a/history.txt
+++ b/history.txt
@@ -1,3 +1,13 @@
+2009-11-18 zzz
+ * Build: Don't update the po files by default, add new
+ target "poupdate" to do that.
+ * Netdb:
+ - Floodfill rework part 3 of N: Send closest-to-the-key
+ in DSRM replies
+ - Adjust criteria for following DSRM
+ - Note failed floods in the profile
+ - Reduce max flood
+
2009-11-16 zzz
* addressbook: Move class to net.i2p.addressbook
* build: Take two test scripts out of the installer
diff --git a/router/java/src/net/i2p/router/RouterVersion.java b/router/java/src/net/i2p/router/RouterVersion.java
index 4c8aefc89..40028c0e0 100644
--- a/router/java/src/net/i2p/router/RouterVersion.java
+++ b/router/java/src/net/i2p/router/RouterVersion.java
@@ -18,7 +18,7 @@ public class RouterVersion {
/** deprecated */
public final static String ID = "Monotone";
public final static String VERSION = CoreVersion.VERSION;
- public final static long BUILD = 18;
+ public final static long BUILD = 19;
/** for example "-test" */
public final static String EXTRA = "";
public final static String FULL_VERSION = VERSION + "-" + BUILD + EXTRA;
diff --git a/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillNetworkDatabaseFacade.java b/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillNetworkDatabaseFacade.java
index 1664094c2..4fbaf381e 100644
--- a/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillNetworkDatabaseFacade.java
+++ b/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillNetworkDatabaseFacade.java
@@ -99,7 +99,7 @@ public class FloodfillNetworkDatabaseFacade extends KademliaNetworkDatabaseFacad
}
}
- private static final int MAX_TO_FLOOD = 9;
+ private static final int MAX_TO_FLOOD = 7;
/**
* Send to a subset of all floodfill peers.
@@ -139,6 +139,10 @@ public class FloodfillNetworkDatabaseFacade extends KademliaNetworkDatabaseFacad
m.setPriority(FLOOD_PRIORITY);
m.setTarget(target);
m.setExpiration(_context.clock().now()+FLOOD_TIMEOUT);
+ // note send failure but don't give credit on success
+ // might need to change this
+ Job floodFail = new FloodFailedJob(_context, peer);
+ m.setOnFailedSendJob(floodFail);
_context.commSystem().processMessage(m);
flooded++;
if (_log.shouldLog(Log.INFO))
@@ -149,6 +153,20 @@ public class FloodfillNetworkDatabaseFacade extends KademliaNetworkDatabaseFacad
_log.info("Flooded the data to " + flooded + " of " + peers.size() + " peers");
}
+ /** note in the profile that the store failed */
+ private static class FloodFailedJob extends JobImpl {
+ private Hash _peer;
+
+ public FloodFailedJob(RouterContext ctx, Hash peer) {
+ super(ctx);
+ _peer = peer;
+ }
+ public String getName() { return "Flood failed"; }
+ public void runJob() {
+ getContext().profileManager().dbStoreFailed(_peer);
+ }
+ }
+
private static final int FLOOD_PRIORITY = 200;
private static final int FLOOD_TIMEOUT = 30*1000;
diff --git a/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillPeerSelector.java b/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillPeerSelector.java
index d2bd15d74..05a771bd3 100644
--- a/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillPeerSelector.java
+++ b/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillPeerSelector.java
@@ -299,4 +299,16 @@ class FloodfillPeerSelector extends PeerSelector {
}
public int size() { return _matches; }
}
+
+ /**
+ * Floodfill peers only. Used only by HandleDatabaseLookupMessageJob to populate the DSRM.
+ *
+ * @param key the original key (NOT the routing key)
+ * @return List of Hash for the peers selected, ordered
+ */
+ @Override
+ public List selectNearest(Hash key, int maxNumRouters, Set peersToIgnore, KBucketSet kbuckets) {
+ Hash rkey = _context.routingKeyGenerator().getRoutingKey(key);
+ return selectFloodfillParticipants(rkey, maxNumRouters, peersToIgnore, kbuckets);
+ }
}
diff --git a/router/java/src/net/i2p/router/networkdb/kademlia/SingleLookupJob.java b/router/java/src/net/i2p/router/networkdb/kademlia/SingleLookupJob.java
index 24c0350f9..0cd2bb6a0 100644
--- a/router/java/src/net/i2p/router/networkdb/kademlia/SingleLookupJob.java
+++ b/router/java/src/net/i2p/router/networkdb/kademlia/SingleLookupJob.java
@@ -1,6 +1,7 @@
package net.i2p.router.networkdb.kademlia;
import net.i2p.data.Hash;
+import net.i2p.data.RouterInfo;
import net.i2p.data.i2np.DatabaseSearchReplyMessage;
import net.i2p.router.JobImpl;
import net.i2p.router.RouterContext;
@@ -10,7 +11,7 @@ import net.i2p.util.Log;
* Ask the peer who sent us the DSRM for the RouterInfos.
*
* If we have the routerInfo already, try to refetch it from that router itself,
- * if we aren't already connected to that router,
+ * (if the info is old or we don't think it is floodfill)
* which will help us establish that router as a good floodfill and speed our
* integration into the network.
*
@@ -32,9 +33,13 @@ class SingleLookupJob extends JobImpl {
Hash peer = _dsrm.getReply(i);
if (peer.equals(getContext().routerHash())) // us
continue;
- if (getContext().netDb().lookupRouterInfoLocally(peer) == null)
+ if (peer.equals(from)) // wtf
+ continue;
+ RouterInfo ri = getContext().netDb().lookupRouterInfoLocally(peer);
+ if (ri == null)
getContext().jobQueue().addJob(new SingleSearchJob(getContext(), peer, from));
- else if (!getContext().commSystem().isEstablished(peer))
+ else if (ri.getPublished() < getContext().clock().now() - 60*60*1000 ||
+ !FloodfillNetworkDatabaseFacade.isFloodfill(ri))
getContext().jobQueue().addJob(new SingleSearchJob(getContext(), peer, peer));
}
}