diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/TunnelController.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/TunnelController.java index 142456f2d6c17d75049bfba983eee3b577a3bcd3..f13a3812e13bf90eee111636a87aaa580935bf0f 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/TunnelController.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/TunnelController.java @@ -324,6 +324,18 @@ public class TunnelController implements Logging { public String getTargetDestination() { return _config.getProperty("targetDestination"); } public String getProxyList() { return _config.getProperty("proxyList"); } public boolean getStartOnLoad() { return "true".equalsIgnoreCase(_config.getProperty("startOnLoad", "true")); } + public String getMyDestination() { + if (_tunnel != null) { + List sessions = _tunnel.getSessions(); + for (int i = 0; i < sessions.size(); i++) { + I2PSession session = (I2PSession)sessions.get(i); + Destination dest = session.getMyDestination(); + if (dest != null) + return dest.toBase64(); + } + } + return null; + } public boolean getIsRunning() { return _running; } public boolean getIsStarting() { return _starting; } diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/IndexBean.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/IndexBean.java index c2120eb2b24aafe63d9f1ab52ad1aa2f75738139..2989dcf7c350ee6c249251ecb8311fa61b469436 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/IndexBean.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/IndexBean.java @@ -350,6 +350,19 @@ public class IndexBean { return ""; } + public String getDestinationBase64(int tunnel) { + TunnelController tun = getController(tunnel); + if (tun != null) { + String rv = tun.getMyDestination(); + if (rv != null) + return rv; + else + return ""; + } else { + return ""; + } + } + /// /// bean props for form submission /// diff --git a/apps/i2ptunnel/jsp/editServer.jsp b/apps/i2ptunnel/jsp/editServer.jsp index 1381a8ee6bbdc9651d636f0a6aa8d583cdac0d9c..5fdfae25c5d2ab895632840de4b3199c998252e4 100644 --- a/apps/i2ptunnel/jsp/editServer.jsp +++ b/apps/i2ptunnel/jsp/editServer.jsp @@ -110,6 +110,10 @@ Port: <input type="text" size="4" maxlength="4" name="targetPort" value="<%=edit </td> </tr> <tr> +<td valign="top" align="left"><b>Local destination:</b><br /><i>(if known)</i></td> +<td valign="top" align="left"><input type="text" size="60" value="<%=editBean.getDestinationBase64(curTunnel)%>" /></td> +</tr> +<tr> <td colspan="2" align="center"> <b><hr size="1"> Advanced networking options<br /> diff --git a/apps/routerconsole/java/src/net/i2p/router/web/NewsFetcher.java b/apps/routerconsole/java/src/net/i2p/router/web/NewsFetcher.java index 4bd776e45f1e80f9d267b38f611f55a0c7430455..e7bbd23d2180d0b70c8b708473be95dd5706cdcc 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/NewsFetcher.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/NewsFetcher.java @@ -33,6 +33,10 @@ public class NewsFetcher implements Runnable, EepGet.StatusListener { _context = ctx; _log = ctx.logManager().getLog(NewsFetcher.class); _instance = this; + updateLastFetched(); + } + + private void updateLastFetched() { File news = new File(NEWS_FILE); if (news.exists()) _lastFetch = news.lastModified(); @@ -58,6 +62,7 @@ public class NewsFetcher implements Runnable, EepGet.StatusListener { } private boolean shouldFetchNews() { + updateLastFetched(); String freq = _context.getProperty(ConfigUpdateHandler.PROP_REFRESH_FREQUENCY); if (freq == null) freq = ConfigUpdateHandler.DEFAULT_REFRESH_FREQUENCY; diff --git a/core/java/src/net/i2p/data/Destination.java b/core/java/src/net/i2p/data/Destination.java index 42f7f88872d806f1396d9dbdda117663e7c33cf6..7f190e35416141191465857040acedfbf904c06d 100644 --- a/core/java/src/net/i2p/data/Destination.java +++ b/core/java/src/net/i2p/data/Destination.java @@ -12,6 +12,7 @@ package net.i2p.data; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.io.FileInputStream; import net.i2p.util.Log; @@ -155,4 +156,22 @@ public class Destination extends DataStructureImpl { if (__calculatedHash == null) __calculatedHash = super.calculateHash(); return __calculatedHash; } + + public static void main(String args[]) { + if (args.length == 0) { + System.err.println("Usage: Destination filename"); + } else { + FileInputStream in = null; + try { + in = new FileInputStream(args[0]); + Destination d = new Destination(); + d.readBytes(in); + System.out.println(d.toBase64()); + } catch (Exception e) { + e.printStackTrace(); + } finally { + if (in != null) try { in.close(); } catch (IOException ioe) {} + } + } + } } \ No newline at end of file diff --git a/history.txt b/history.txt index b7f507747b0e312adad7346a3286af39cbcf6bc5..9c2225b99a19424c971f9d5a63b126312e0db9b4 100644 --- a/history.txt +++ b/history.txt @@ -1,4 +1,11 @@ -$Id: history.txt,v 1.182 2005/03/26 02:13:38 jrandom Exp $ +$Id: history.txt,v 1.183 2005/03/29 19:07:40 jrandom Exp $ + +2005-04-01 jrandom + * Fix to check for missing news file (thanks smeghead!) + * Added destination display CLI: + java -cp lib/i2p.jar net.i2p.data.Destination privKeyFilename + * Added destination display to the web interface (thanks pnspns) + * Installed CIA backdoor * 2005-03-29 0.5.0.5 released diff --git a/router/java/src/net/i2p/router/RouterVersion.java b/router/java/src/net/i2p/router/RouterVersion.java index d8a40488c0bf84644d3b24808d67194630c698c4..831e6591cf3ccdabc58036704b49155645b15494 100644 --- a/router/java/src/net/i2p/router/RouterVersion.java +++ b/router/java/src/net/i2p/router/RouterVersion.java @@ -15,9 +15,9 @@ import net.i2p.CoreVersion; * */ public class RouterVersion { - public final static String ID = "$Revision: 1.175 $ $Date: 2005/03/26 02:13:38 $"; + public final static String ID = "$Revision: 1.176 $ $Date: 2005/03/29 19:07:39 $"; public final static String VERSION = "0.5.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); diff --git a/router/java/src/net/i2p/router/message/OutboundClientMessageOneShotJob.java b/router/java/src/net/i2p/router/message/OutboundClientMessageOneShotJob.java index 73af5c9e361ca9d2d93e7e2475f260f367d1e1de..e028995132a7d199544876650716983fa40251c0 100644 --- a/router/java/src/net/i2p/router/message/OutboundClientMessageOneShotJob.java +++ b/router/java/src/net/i2p/router/message/OutboundClientMessageOneShotJob.java @@ -288,8 +288,10 @@ public class OutboundClientMessageOneShotJob extends JobImpl { getContext().statManager().addRateData("client.leaseSetFailedRemoteTime", lookupTime, lookupTime); } - if (_log.shouldLog(Log.ERROR)) - _log.error("Unable to send to " + _toString + " because we couldn't find their leaseSet"); + if (!_finished) { + if (_log.shouldLog(Log.ERROR)) + _log.error("Unable to send to " + _toString + " because we couldn't find their leaseSet"); + } dieFatal(); } diff --git a/router/java/src/net/i2p/router/networkdb/kademlia/SearchJob.java b/router/java/src/net/i2p/router/networkdb/kademlia/SearchJob.java index f772f9174858851b95204b87c52e33a63640068a..d1c137fba8784a0b3ef259750a5999721c7a2641 100644 --- a/router/java/src/net/i2p/router/networkdb/kademlia/SearchJob.java +++ b/router/java/src/net/i2p/router/networkdb/kademlia/SearchJob.java @@ -204,8 +204,12 @@ class SearchJob extends JobImpl { + peer + " : " + (ds == null ? "null" : ds.getClass().getName())); _state.replyTimeout(peer); } else { - sendSearch((RouterInfo)ds); - sent++; + if (getContext().shitlist().isShitlisted(peer)) { + // dont bother + } else { + sendSearch((RouterInfo)ds); + sent++; + } } } if (sent <= 0) {