2005-04-01 jrandom

* Allow editing I2PTunnel server instances with five digit ports
      (thanks nickless_head!)
    * More NewsFetcher debugging for reported weirdness
This commit is contained in:
jrandom
2005-04-01 13:29:26 +00:00
committed by zzz
parent 33366cc291
commit c9c1eae32f
4 changed files with 20 additions and 7 deletions

View File

@ -77,7 +77,7 @@ if (curTunnel >= 0) {
</td>
<td>
Host: <input type="text" size="20" name="targetHost" value="<%=editBean.getTargetHost(curTunnel)%>" />
Port: <input type="text" size="4" maxlength="4" name="targetPort" value="<%=editBean.getTargetPort(curTunnel)%>" />
Port: <input type="text" size="6" maxlength="5" name="targetPort" value="<%=editBean.getTargetPort(curTunnel)%>" />
</td>
</tr>
<% String curType = editBean.getInternalType(curTunnel);

View File

@ -113,8 +113,9 @@ public class NewsFetcher implements Runnable, EepGet.StatusListener {
private static final String VERSION_STRING = "version=\"" + RouterVersion.VERSION + "\"";
private static final String VERSION_PREFIX = "version=\"";
private void checkForUpdates() {
_updateAvailable = false;
File news = new File(NEWS_FILE);
if (!news.exists()) return;
if ( (!news.exists()) || (news.length() <= 0) ) return;
FileInputStream in = null;
try {
in = new FileInputStream(news);
@ -240,13 +241,20 @@ public class NewsFetcher implements Runnable, EepGet.StatusListener {
}
public void transferComplete(long alreadyTransferred, long bytesTransferred, long bytesRemaining, String url, String outputFile) {
if (_log.shouldLog(Log.INFO))
_log.info("News fetched from " + url);
_log.info("News fetched from " + url + " with " + (alreadyTransferred+bytesTransferred));
File temp = new File(TEMP_NEWS_FILE);
if (temp.exists()) {
boolean copied = FileUtil.copy(TEMP_NEWS_FILE, NEWS_FILE, true);
if (copied)
if (copied) {
temp.delete();
} else {
if (_log.shouldLog(Log.ERROR))
_log.error("Failed to copy the news file!");
}
} else {
if (_log.shouldLog(Log.ERROR))
_log.error("Transfer complete, but no file?");
}
checkForUpdates();
}

View File

@ -1,4 +1,9 @@
$Id: history.txt,v 1.183 2005/03/29 19:07:40 jrandom Exp $
$Id: history.txt,v 1.184 2005/04/01 06:28:07 jrandom Exp $
2005-04-01 jrandom
* Allow editing I2PTunnel server instances with five digit ports
(thanks nickless_head!)
* More NewsFetcher debugging for reported weirdness
2005-04-01 jrandom
* Fix to check for missing news file (thanks smeghead!)

View File

@ -15,9 +15,9 @@ import net.i2p.CoreVersion;
*
*/
public class RouterVersion {
public final static String ID = "$Revision: 1.176 $ $Date: 2005/03/29 19:07:39 $";
public final static String ID = "$Revision: 1.177 $ $Date: 2005/04/01 06:28:06 $";
public final static String VERSION = "0.5.0.5";
public final static long BUILD = 1;
public final static long BUILD = 2;
public static void main(String args[]) {
System.out.println("I2P Router version: " + VERSION);
System.out.println("Router ID: " + RouterVersion.ID);