2005-04-12 jrandom
* Make sure we don't get cached updates (thanks smeghead!) * Clear out the callback for the TestJob after it passes (only affects the job timing accounting)
This commit is contained in:
@ -113,9 +113,9 @@ public class UpdateHandler {
|
||||
try {
|
||||
EepGet get = null;
|
||||
if (shouldProxy)
|
||||
get = new EepGet(_context, proxyHost, proxyPort, 10, SIGNED_UPDATE_FILE, updateURL);
|
||||
get = new EepGet(_context, proxyHost, proxyPort, 10, SIGNED_UPDATE_FILE, updateURL, false);
|
||||
else
|
||||
get = new EepGet(_context, 10, SIGNED_UPDATE_FILE, updateURL);
|
||||
get = new EepGet(_context, 10, SIGNED_UPDATE_FILE, updateURL, false);
|
||||
get.addStatusListener(UpdateRunner.this);
|
||||
_startedOn = _context.clock().now();
|
||||
get.fetch();
|
||||
|
@ -35,6 +35,7 @@ public class EepGet {
|
||||
private int _numRetries;
|
||||
private String _outputFile;
|
||||
private String _url;
|
||||
private boolean _allowCaching;
|
||||
private List _listeners;
|
||||
|
||||
private boolean _keepFetching;
|
||||
@ -52,10 +53,19 @@ public class EepGet {
|
||||
public EepGet(I2PAppContext ctx, String proxyHost, int proxyPort, int numRetries, String outputFile, String url) {
|
||||
this(ctx, true, proxyHost, proxyPort, numRetries, outputFile, url);
|
||||
}
|
||||
public EepGet(I2PAppContext ctx, String proxyHost, int proxyPort, int numRetries, String outputFile, String url, boolean allowCaching) {
|
||||
this(ctx, true, proxyHost, proxyPort, numRetries, outputFile, url, allowCaching);
|
||||
}
|
||||
public EepGet(I2PAppContext ctx, int numRetries, String outputFile, String url) {
|
||||
this(ctx, false, null, -1, numRetries, outputFile, url);
|
||||
}
|
||||
public EepGet(I2PAppContext ctx, int numRetries, String outputFile, String url, boolean allowCaching) {
|
||||
this(ctx, false, null, -1, numRetries, outputFile, url, allowCaching);
|
||||
}
|
||||
public EepGet(I2PAppContext ctx, boolean shouldProxy, String proxyHost, int proxyPort, int numRetries, String outputFile, String url) {
|
||||
this(ctx, shouldProxy, proxyHost, proxyPort, numRetries, outputFile, url, true);
|
||||
}
|
||||
public EepGet(I2PAppContext ctx, boolean shouldProxy, String proxyHost, int proxyPort, int numRetries, String outputFile, String url, boolean allowCaching) {
|
||||
_context = ctx;
|
||||
_log = ctx.logManager().getLog(EepGet.class);
|
||||
_shouldProxy = shouldProxy;
|
||||
@ -550,6 +560,10 @@ public class EepGet {
|
||||
buf.append("-\n");
|
||||
}
|
||||
buf.append("Accept-Encoding: identity;q=1, *;q=0\n");
|
||||
if (!_allowCaching) {
|
||||
buf.append("Cache-control: no-cache\n");
|
||||
buf.append("Pragma: no-cache\n");
|
||||
}
|
||||
buf.append("Connection: close\n\n");
|
||||
if (_log.shouldLog(Log.DEBUG))
|
||||
_log.debug("Request: [" + buf.toString() + "]");
|
||||
|
@ -1,4 +1,9 @@
|
||||
$Id: history.txt,v 1.190 2005/04/08 07:39:20 smeghead Exp $
|
||||
$Id: history.txt,v 1.191 2005/04/08 22:16:05 smeghead Exp $
|
||||
|
||||
2005-04-12 jrandom
|
||||
* Make sure we don't get cached updates (thanks smeghead!)
|
||||
* Clear out the callback for the TestJob after it passes (only affects the
|
||||
job timing accounting)
|
||||
|
||||
2005-04-08 smeghead
|
||||
* Added NativeBigInteger benchmark to scripts/i2pbench.sh.
|
||||
|
@ -15,9 +15,9 @@ import net.i2p.CoreVersion;
|
||||
*
|
||||
*/
|
||||
public class RouterVersion {
|
||||
public final static String ID = "$Revision: 1.182 $ $Date: 2005/04/06 10:43:25 $";
|
||||
public final static String ID = "$Revision: 1.183 $ $Date: 2005/04/06 11:38:38 $";
|
||||
public final static String VERSION = "0.5.0.6";
|
||||
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);
|
||||
|
@ -12,6 +12,7 @@ import net.i2p.data.i2np.GarlicMessage;
|
||||
import net.i2p.data.i2np.I2NPMessage;
|
||||
import net.i2p.router.JobImpl;
|
||||
import net.i2p.router.MessageSelector;
|
||||
import net.i2p.router.OutNetMessage;
|
||||
import net.i2p.router.ReplyJob;
|
||||
import net.i2p.router.RouterContext;
|
||||
import net.i2p.router.TunnelInfo;
|
||||
@ -78,7 +79,8 @@ class TestJob extends JobImpl {
|
||||
ReplySelector sel = new ReplySelector(getContext(), m.getMessageId(), testExpiration + 2*testPeriod);
|
||||
OnTestReply onReply = new OnTestReply(getContext());
|
||||
OnTestTimeout onTimeout = new OnTestTimeout(getContext());
|
||||
getContext().messageRegistry().registerPending(sel, onReply, onTimeout, 3*testPeriod);
|
||||
OutNetMessage msg = getContext().messageRegistry().registerPending(sel, onReply, onTimeout, 3*testPeriod);
|
||||
onReply.setSentMessage(msg);
|
||||
sendTest(m);
|
||||
}
|
||||
}
|
||||
@ -201,9 +203,13 @@ class TestJob extends JobImpl {
|
||||
*/
|
||||
private class OnTestReply extends JobImpl implements ReplyJob {
|
||||
private long _successTime;
|
||||
private OutNetMessage _sentMessage;
|
||||
public OnTestReply(RouterContext ctx) { super(ctx); }
|
||||
public String getName() { return "Tunnel test success"; }
|
||||
public void setSentMessage(OutNetMessage m) { _sentMessage = m; }
|
||||
public void runJob() {
|
||||
if (_sentMessage != null)
|
||||
getContext().messageRegistry().unregisterPending(_sentMessage);
|
||||
if (_successTime < getTestPeriod())
|
||||
testSuccessful((int)_successTime);
|
||||
else
|
||||
@ -234,6 +240,7 @@ class TestJob extends JobImpl {
|
||||
}
|
||||
public String getName() { return "Tunnel test timeout"; }
|
||||
public void runJob() {
|
||||
_log.error("Timeout: found? " + _found, getAddedBy());
|
||||
if (!_found)
|
||||
testFailed(getContext().clock().now() - _started);
|
||||
}
|
||||
|
Reference in New Issue
Block a user