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:
jrandom
2005-09-04 19:15:49 +00:00
committed by zzz
parent 779aa240d2
commit d4a859547c
22 changed files with 640 additions and 66 deletions

View File

@ -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);

View File

@ -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() {

View File

@ -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;

View File

@ -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());

View File

@ -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();
}
}
/**