Updates after review:

Remove meeh.i2p as update host (ticket #1515)
Re-add 193.xxx https reseed
Fix SocketManagerFactory property handling
Restore UPnP locale fix lost in the merge
i2ptunnel finals
I2NP unique id fixes
duplicate done() in ReseedChecker
bigger langbox in CSS
reformatting
Javadocs
This commit is contained in:
zzz
2015-04-11 19:34:34 +00:00
parent 69a0324e86
commit dd265bbd54
23 changed files with 47 additions and 26 deletions

View File

@ -44,6 +44,7 @@ public class TunnelController implements Logging {
private List<I2PSession> _sessions; private List<I2PSession> _sessions;
private volatile TunnelState _state; private volatile TunnelState _state;
/** @since 0.9.19 */
private enum TunnelState { private enum TunnelState {
START_ON_LOAD, START_ON_LOAD,
STARTING, STARTING,
@ -849,6 +850,7 @@ public class TunnelController implements Logging {
return true; return true;
} }
/** @since 0.9.19 */
private synchronized void changeState(TunnelState state) { private synchronized void changeState(TunnelState state) {
_state = state; _state = state;
} }

View File

@ -44,8 +44,8 @@ public class GeneralHelper {
private static final String OPT = TunnelController.PFX_OPTION; private static final String OPT = TunnelController.PFX_OPTION;
private I2PAppContext _context; private final I2PAppContext _context;
protected TunnelControllerGroup _group; protected final TunnelControllerGroup _group;
public GeneralHelper(TunnelControllerGroup tcg) { public GeneralHelper(TunnelControllerGroup tcg) {
this(I2PAppContext.getGlobalContext(), tcg); this(I2PAppContext.getGlobalContext(), tcg);

View File

@ -53,7 +53,7 @@ public class IndexBean {
private String _curNonce; private String _curNonce;
//private long _nextNonce; //private long _nextNonce;
private TunnelConfig _config; private final TunnelConfig _config;
private boolean _removeConfirmed; private boolean _removeConfirmed;
private int _hashCashValue; private int _hashCashValue;
private int _certType; private int _certType;

View File

@ -227,7 +227,7 @@ public class I2PSocketManagerFactory {
Properties syscopy = (Properties) System.getProperties().clone(); Properties syscopy = (Properties) System.getProperties().clone();
for (Map.Entry<Object, Object> e : syscopy.entrySet()) { for (Map.Entry<Object, Object> e : syscopy.entrySet()) {
String name = (String) e.getKey(); String name = (String) e.getKey();
if (opts.getProperty(name) != null) if (opts.getProperty(name) == null)
opts.setProperty(name, (String) e.getValue()); opts.setProperty(name, (String) e.getValue());
} }
// as of 0.8.1 (I2CP default is BestEffort) // as of 0.8.1 (I2CP default is BestEffort)

View File

@ -27,6 +27,7 @@ public class ConfigNavHelper extends HelperBase {
_x("Clients"), _x("Peers"), _x("Keyring"), _x("Logging"), _x("Stats"), _x("Clients"), _x("Peers"), _x("Keyring"), _x("Logging"), _x("Stats"),
_x("Reseeding"), _x("Advanced") }; _x("Reseeding"), _x("Advanced") };
/** @since 0.9.19 */
private static class Tab { private static class Tab {
public final String page, title; public final String page, title;
public Tab(String p, String t) { public Tab(String p, String t) {
@ -34,6 +35,7 @@ public class ConfigNavHelper extends HelperBase {
} }
} }
/** @since 0.9.19 */
private class TabComparator implements Comparator<Tab> { private class TabComparator implements Comparator<Tab> {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private final Collator coll; private final Collator coll;

View File

@ -69,7 +69,7 @@ public class ConfigUpdateHandler extends FormHandler {
private static final String PACK200_URLS = private static final String PACK200_URLS =
"http://echelon.i2p/i2p/i2pupdate.su2\r\n" + "http://echelon.i2p/i2p/i2pupdate.su2\r\n" +
"http://inr.i2p/i2p/i2pupdate.su2\r\n" + "http://inr.i2p/i2p/i2pupdate.su2\r\n" +
"http://meeh.i2p/i2pupdate/i2pupdate.su2\r\n" + //"http://meeh.i2p/i2pupdate/i2pupdate.su2\r\n" +
"http://stats.i2p/i2p/i2pupdate.su2\r\n" + "http://stats.i2p/i2p/i2pupdate.su2\r\n" +
// "http://www.i2p2.i2p/_static/i2pupdate.su2\r\n" + // "http://www.i2p2.i2p/_static/i2pupdate.su2\r\n" +
"http://update.dg.i2p/files/i2pupdate.su2\r\n" + "http://update.dg.i2p/files/i2pupdate.su2\r\n" +
@ -79,7 +79,7 @@ public class ConfigUpdateHandler extends FormHandler {
private static final String NO_PACK200_URLS = private static final String NO_PACK200_URLS =
"http://echelon.i2p/i2p/i2pupdate.sud\r\n" + "http://echelon.i2p/i2p/i2pupdate.sud\r\n" +
"http://inr.i2p/i2p/i2pupdate.sud\r\n" + "http://inr.i2p/i2p/i2pupdate.sud\r\n" +
"http://meeh.i2p/i2pupdate/i2pupdate.sud\r\n" + //"http://meeh.i2p/i2pupdate/i2pupdate.sud\r\n" +
"http://stats.i2p/i2p/i2pupdate.sud\r\n" + "http://stats.i2p/i2p/i2pupdate.sud\r\n" +
// "http://www.i2p2.i2p/_static/i2pupdate.sud\r\n" + // "http://www.i2p2.i2p/_static/i2pupdate.sud\r\n" +
"http://update.dg.i2p/files/i2pupdate.sud\r\n" + "http://update.dg.i2p/files/i2pupdate.sud\r\n" +
@ -113,7 +113,7 @@ public class ConfigUpdateHandler extends FormHandler {
private static final String DEFAULT_SU3_UPDATE_URLS = private static final String DEFAULT_SU3_UPDATE_URLS =
"http://echelon.i2p/i2p/i2pupdate.su3\r\n" + "http://echelon.i2p/i2p/i2pupdate.su3\r\n" +
"http://inr.i2p/i2p/i2pupdate.su3\r\n" + "http://inr.i2p/i2p/i2pupdate.su3\r\n" +
"http://meeh.i2p/i2pupdate/i2pupdate.su3\r\n" + //"http://meeh.i2p/i2pupdate/i2pupdate.su3\r\n" +
"http://stats.i2p/i2p/i2pupdate.su3\r\n" + "http://stats.i2p/i2p/i2pupdate.su3\r\n" +
// "http://www.i2p2.i2p/_static/i2pupdate.su3\r\n" + // "http://www.i2p2.i2p/_static/i2pupdate.su3\r\n" +
"http://update.dg.i2p/files/i2pupdate.su3\r\n" + "http://update.dg.i2p/files/i2pupdate.su3\r\n" +

View File

@ -156,8 +156,7 @@ class IntelInfoImpl extends CPUIDCPUInfo implements IntelCPUInfo
isPentiumMCompatible = true; isPentiumMCompatible = true;
isCore2Compatible = true; isCore2Compatible = true;
isX64 = true; isX64 = true;
} if (extmodel >= 2)
if (extmodel >= 2) {
isCoreiCompatible = true; isCoreiCompatible = true;
} }
switch (model) { switch (model) {

View File

@ -77,9 +77,10 @@ public final class SHA256Generator {
digest.digest(out, outOffset, Hash.HASH_LENGTH); digest.digest(out, outOffset, Hash.HASH_LENGTH);
} catch (DigestException e) { } catch (DigestException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} } finally {
release(digest); release(digest);
} }
}
private MessageDigest acquire() { private MessageDigest acquire() {
MessageDigest rv = _digests.poll(); MessageDigest rv = _digests.poll();

View File

@ -74,6 +74,9 @@ class LogWriter extends LogWriterBase {
} }
} }
/**
* @since 0.9.19
*/
protected void flushWriter() { protected void flushWriter() {
try { try {
if (_currentOut != null) if (_currentOut != null)
@ -84,6 +87,9 @@ class LogWriter extends LogWriterBase {
} }
} }
/**
* @since 0.9.19 renamed from closeFile()
*/
protected void closeWriter() { protected void closeWriter() {
Writer out = _currentOut; Writer out = _currentOut;
if (out != null) { if (out != null) {

View File

@ -16,6 +16,7 @@ import java.util.Queue;
* the log. This also periodically instructs the LogManager to reread its config * the log. This also periodically instructs the LogManager to reread its config
* file. * file.
* *
* @since 0.9.19 pulled from LogWriter so Android may extend
*/ */
abstract class LogWriterBase implements Runnable { abstract class LogWriterBase implements Runnable {
/** every 10 seconds? why? Just have the gui force a reread after a change?? */ /** every 10 seconds? why? Just have the gui force a reread after a change?? */

View File

@ -196,10 +196,9 @@ public class NativeBigInteger extends BigInteger {
private final static String sCPUType; //The CPU Type to optimize for (one of the above strings) private final static String sCPUType; //The CPU Type to optimize for (one of the above strings)
static { static {
if (_isX86) {// Don't try to resolve CPU type on non x86 hardware if (_isX86) { // Don't try to resolve CPU type on non x86 hardware
sCPUType = resolveCPUType(); sCPUType = resolveCPUType();
} } else if (_isArm) {
else if (_isArm) {
sCPUType = JBIGI_OPTIMIZATION_ARM; sCPUType = JBIGI_OPTIMIZATION_ARM;
} else if (_isPPC && !_isMac) { } else if (_isPPC && !_isMac) {
sCPUType = JBIGI_OPTIMIZATION_PPC; sCPUType = JBIGI_OPTIMIZATION_PPC;

View File

@ -1,3 +1,6 @@
2015-04-11 zzz
* Updates after review
2015-04-09 kytv 2015-04-09 kytv
* Updates to geoip.txt and geoipv6.dat.gz based on Maxmind GeoLite Country * Updates to geoip.txt and geoipv6.dat.gz based on Maxmind GeoLite Country
database from 2015-04-07. database from 2015-04-07.

View File

@ -995,7 +995,7 @@ p img:first-child {
margin: 5px 5px 0 5px; margin: 5px 5px 0 5px;
color: #001; color: #001;
font-size: 7pt; font-size: 7pt;
width: 320px; width: 330px;
text-align: right; text-align: right;
float: right; float: right;
valign: middle; valign: middle;

View File

@ -882,7 +882,7 @@ button:active {
padding: 0; padding: 0;
color: #EE9; color: #EE9;
font-size: 7pt; font-size: 7pt;
width: 290px; width: 300px;
text-align: right; text-align: right;
float: right; float: right;
vertical-align: middle; vertical-align: middle;

View File

@ -1088,7 +1088,7 @@ button:active {
padding: 2px 5px; padding: 2px 5px;
color: #001; color: #001;
font-size: 7pt; font-size: 7pt;
width: 320px; width: 330px;
text-align: right; text-align: right;
float: right; float: right;
vertical-align: middle; vertical-align: middle;

View File

@ -256,7 +256,7 @@ public class DatabaseStoreMessage extends FastI2NPMessageImpl {
StringBuilder buf = new StringBuilder(); StringBuilder buf = new StringBuilder();
buf.append("[DatabaseStoreMessage: "); buf.append("[DatabaseStoreMessage: ");
buf.append("\n\tExpiration: ").append(new Date(_expiration)); buf.append("\n\tExpiration: ").append(new Date(_expiration));
buf.append("\n\tUnique ID: ").append(_uniqueId); buf.append("\n\tUnique ID: ").append(getUniqueId());
if (_replyToken != 0) { if (_replyToken != 0) {
buf.append("\n\tReply token: ").append(_replyToken); buf.append("\n\tReply token: ").append(_replyToken);
buf.append("\n\tReply tunnel: ").append(_replyTunnel); buf.append("\n\tReply tunnel: ").append(_replyTunnel);

View File

@ -31,6 +31,13 @@ public abstract class I2NPMessageImpl extends DataStructureImpl implements I2NPM
protected final Log _log; protected final Log _log;
protected final I2PAppContext _context; protected final I2PAppContext _context;
protected long _expiration; protected long _expiration;
/**
* Warning, lazily initialized by readBytes(), writeBytes(), toByteArray(),
* getUniqueId(), and setUniqueId(); otherwise will be -1.
* Extending classes should take care when accessing this field;
* to ensure initialization, use getUniqueId() instead.
*/
protected long _uniqueId = -1; protected long _uniqueId = -1;
public final static long DEFAULT_EXPIRATION_MS = 1*60*1000; // 1 minute by default public final static long DEFAULT_EXPIRATION_MS = 1*60*1000; // 1 minute by default
@ -257,7 +264,7 @@ public abstract class I2NPMessageImpl extends DataStructureImpl implements I2NPM
} }
/** /**
* The ID is set to a random value in the constructor but it can be overridden here. * The ID is set to a random value when written but it can be overridden here.
*/ */
public void setUniqueId(long id) { _uniqueId = id; } public void setUniqueId(long id) { _uniqueId = id; }

View File

@ -234,7 +234,7 @@ public class TunnelDataMessage extends FastI2NPMessageImpl {
public String toString() { public String toString() {
StringBuilder buf = new StringBuilder(); StringBuilder buf = new StringBuilder();
buf.append("[TunnelDataMessage:"); buf.append("[TunnelDataMessage:");
buf.append(" MessageId: ").append(_uniqueId); buf.append(" MessageId: ").append(getUniqueId());
buf.append(" Tunnel ID: ").append(_tunnelId); buf.append(" Tunnel ID: ").append(_tunnelId);
buf.append("]"); buf.append("]");
return buf.toString(); return buf.toString();

View File

@ -1508,7 +1508,7 @@ public class Router implements RouterClock.ClockShiftListener {
* Context must be available. * Context must be available.
* Unzip update file found in the router dir OR base dir, to the base dir * Unzip update file found in the router dir OR base dir, to the base dir
* *
* If successfull, will call exit() and never return. * If successful, will call exit() and never return.
* *
* If we can't write to the base dir, complain. * If we can't write to the base dir, complain.
* Note: _log not available here. * Note: _log not available here.

View File

@ -18,7 +18,7 @@ public class RouterVersion {
/** deprecated */ /** deprecated */
public final static String ID = "Monotone"; public final static String ID = "Monotone";
public final static String VERSION = CoreVersion.VERSION; public final static String VERSION = CoreVersion.VERSION;
public final static long BUILD = 19; public final static long BUILD = 20;
/** for example "-test" */ /** for example "-test" */
public final static String EXTRA = "-rc"; public final static String EXTRA = "-rc";

View File

@ -158,7 +158,6 @@ public class ReseedChecker {
} catch (IOException ioe) { } catch (IOException ioe) {
if (ioe.getMessage() != null) if (ioe.getMessage() != null)
setError(DataHelper.escapeHTML(ioe.getMessage())); setError(DataHelper.escapeHTML(ioe.getMessage()));
done();
throw ioe; throw ioe;
} finally { } finally {
done(); done();

View File

@ -88,6 +88,7 @@ public class Reseeder {
"https://netdb.rows.io:444/" + "," + // Only HTTPS and SU3 (v3) support "https://netdb.rows.io:444/" + "," + // Only HTTPS and SU3 (v3) support
"https://i2pseed.zarrenspry.info/" + "," + // Only HTTPS and SU3 (v3) support "https://i2pseed.zarrenspry.info/" + "," + // Only HTTPS and SU3 (v3) support
"https://i2p.mooo.com/netDb/" + "," + "https://i2p.mooo.com/netDb/" + "," +
"https://193.150.121.66/netDb/" + "," +
"https://netdb.i2p2.no/" + "," + // Only SU3 (v3) support "https://netdb.i2p2.no/" + "," + // Only SU3 (v3) support
"https://us.reseed.i2p2.no:444/" + "," + "https://us.reseed.i2p2.no:444/" + "," +
"https://uk.reseed.i2p2.no:444/" + "," + "https://uk.reseed.i2p2.no:444/" + "," +

View File

@ -18,6 +18,7 @@ package org.cybergarage.util;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.util.Locale;
public final class FileUtil public final class FileUtil
{ {
@ -72,7 +73,7 @@ public final class FileUtil
{ {
if (StringUtil.hasData(name) == false) if (StringUtil.hasData(name) == false)
return false; return false;
String lowerName = name.toLowerCase(); String lowerName = name.toLowerCase(Locale.US);
return lowerName.endsWith("xml"); return lowerName.endsWith("xml");
} }
} }