forked from I2P_Developers/i2p.i2p
2005-09-04 jrandom
* Don't persist peer profiles until we are shutting down, as the persistence process gobbles RAM and wall time. * Bugfix to allow you to check/uncheck the sharedClient setting on the I2PTunnel web interface. * Be more careful when expiring a failed tunnel message fragment so we don't drop the data while attempting to read it.
This commit is contained in:
@ -15,9 +15,9 @@ import net.i2p.CoreVersion;
|
||||
*
|
||||
*/
|
||||
public class RouterVersion {
|
||||
public final static String ID = "$Revision: 1.225 $ $Date: 2005/09/02 13:34:15 $";
|
||||
public final static String ID = "$Revision: 1.226 $ $Date: 2005/09/02 14:10:06 $";
|
||||
public final static String VERSION = "0.6.0.5";
|
||||
public final static long BUILD = 0;
|
||||
public final static long BUILD = 1;
|
||||
public static void main(String args[]) {
|
||||
System.out.println("I2P Router version: " + VERSION);
|
||||
System.out.println("Router ID: " + RouterVersion.ID);
|
||||
|
@ -39,7 +39,7 @@ class PeerManager {
|
||||
_organizer.setUs(context.routerHash());
|
||||
loadProfiles();
|
||||
_context.jobQueue().addJob(new EvaluateProfilesJob(_context));
|
||||
_context.jobQueue().addJob(new PersistProfilesJob(_context, this));
|
||||
//_context.jobQueue().addJob(new PersistProfilesJob(_context, this));
|
||||
}
|
||||
|
||||
void storeProfiles() {
|
||||
|
@ -408,7 +408,7 @@ class PeerTestManager {
|
||||
charlieInfo = _context.netDb().lookupRouterInfoLocally(charlie.getRemotePeer());
|
||||
}
|
||||
|
||||
if (charlie == null) {
|
||||
if ( (charlie == null) || (charlieInfo == null) ) {
|
||||
if (_log.shouldLog(Log.WARN))
|
||||
_log.warn("Unable to pick a charlie");
|
||||
return;
|
||||
|
@ -353,6 +353,8 @@ public class FragmentHandler {
|
||||
_completed++;
|
||||
try {
|
||||
byte data[] = msg.toByteArray();
|
||||
if (msg == null)
|
||||
return;
|
||||
if (_log.shouldLog(Log.DEBUG))
|
||||
_log.debug("RECV(" + data.length + "): " + Base64.encode(data)
|
||||
+ " " + _context.sha().calculateHash(data).toBase64());
|
||||
|
@ -214,15 +214,20 @@ public class FragmentedMessage {
|
||||
_completed = true;
|
||||
}
|
||||
public byte[] toByteArray() {
|
||||
byte rv[] = new byte[getCompleteSize()];
|
||||
writeComplete(rv, 0);
|
||||
releaseFragments();
|
||||
return rv;
|
||||
synchronized (this) {
|
||||
if (_releasedAfter > 0) return null;
|
||||
byte rv[] = new byte[getCompleteSize()];
|
||||
writeComplete(rv, 0);
|
||||
releaseFragments();
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
|
||||
public long getReleasedAfter() { return _releasedAfter; }
|
||||
public void failed() {
|
||||
releaseFragments();
|
||||
synchronized (this) {
|
||||
releaseFragments();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user