2005-10-04 jrandom

* Syndie patch for single user remote archives (thanks nickless_head!)
    * Handle an invalid netDb store (thanks Complication!)
This commit is contained in:
jrandom
2005-10-04 23:43:05 +00:00
committed by zzz
parent 0013677b83
commit 70b6f97abe
6 changed files with 16 additions and 4 deletions

View File

@ -269,6 +269,7 @@ public class RemoteArchiveBean {
_proxyHost = null;
_proxyPort = -1;
_exportCapable = false;
if (user == null) user = new User();
if ( (schema == null) || (schema.trim().length() <= 0) ||
(location == null) || (location.trim().length() <= 0) ) {

View File

@ -1,4 +1,8 @@
$Id: history.txt,v 1.280 2005/10/03 21:05:52 jrandom Exp $
$Id: history.txt,v 1.281 2005/10/04 02:36:25 jrandom Exp $
2005-10-04 jrandom
* Syndie patch for single user remote archives (thanks nickless_head!)
* Handle an invalid netDb store (thanks Complication!)
2005-10-04 jrandom
* Further reduction in unnecessary streaming packets.

View File

@ -15,9 +15,9 @@ import net.i2p.CoreVersion;
*
*/
public class RouterVersion {
public final static String ID = "$Revision: 1.255 $ $Date: 2005/10/03 21:05:52 $";
public final static String ID = "$Revision: 1.256 $ $Date: 2005/10/04 02:36:25 $";
public final static String VERSION = "0.6.1.1";
public final static long BUILD = 2;
public final static long BUILD = 3;
public static void main(String args[]) {
System.out.println("I2P Router version: " + VERSION + "-" + BUILD);
System.out.println("Router ID: " + RouterVersion.ID);

View File

@ -30,6 +30,7 @@ public class FloodfillNetworkDatabaseFacade extends KademliaNetworkDatabaseFacad
* @throws IllegalArgumentException if the local router info is invalid
*/
public void publish(RouterInfo localRouterInfo) throws IllegalArgumentException {
if (localRouterInfo == null) throw new IllegalArgumentException("wtf, null localRouterInfo?");
super.publish(localRouterInfo);
sendStore(localRouterInfo.getIdentity().calculateHash(), localRouterInfo, null, null, PUBLISH_TIMEOUT, null);
}

View File

@ -130,7 +130,8 @@ public class FloodfillVerifyStoreJob extends JobImpl {
ds = _facade.lookupLeaseSetLocally(_key);
if (ds == null)
ds = _facade.lookupRouterInfoLocally(_key);
_facade.sendStore(_key, ds, null, null, VERIFY_TIMEOUT, null);
if (ds != null)
_facade.sendStore(_key, ds, null, null, VERIFY_TIMEOUT, null);
}
private class VerifyTimeoutJob extends JobImpl {

View File

@ -850,6 +850,11 @@ public class KademliaNetworkDatabaseFacade extends NetworkDatabaseFacade {
}
public void sendStore(Hash key, DataStructure ds, Job onSuccess, Job onFailure, long sendTimeout, Set toIgnore) {
if ( (ds == null) || (key == null) ) {
if (onFailure != null)
_context.jobQueue().addJob(onFailure);
return;
}
_context.jobQueue().addJob(new StoreJob(_context, this, key, ds, onSuccess, onFailure, sendTimeout, toIgnore));
}