forked from I2P_Developers/i2p.i2p
propagate from branch 'i2p.i2p' (head c62904685f0153a5b8cd032e8b3f1c4f64c5bec9)
to branch 'i2p.i2p.str4d.ui' (head 2a82ccb644906256af7bd0827725dc83e4c76be2)
This commit is contained in:
@@ -893,11 +893,16 @@ public class TrackerClient implements Runnable {
|
||||
} catch (URISyntaxException use) {
|
||||
return false;
|
||||
}
|
||||
String path = url.getPath();
|
||||
if (path == null || !path.startsWith("/"))
|
||||
return false;
|
||||
return "http".equals(url.getScheme()) && url.getHost() != null &&
|
||||
(url.getHost().endsWith(".i2p") || url.getHost().equals("i2p"));
|
||||
}
|
||||
|
||||
/**
|
||||
* This also validates the URL.
|
||||
*
|
||||
* @param ann an announce URL non-null
|
||||
* @return a Hash for i2p hosts only, null otherwise
|
||||
* @since 0.9.5
|
||||
@@ -914,8 +919,12 @@ public class TrackerClient implements Runnable {
|
||||
String host = url.getHost();
|
||||
if (host == null)
|
||||
return null;
|
||||
if (host.endsWith(".i2p"))
|
||||
if (host.endsWith(".i2p")) {
|
||||
String path = url.getPath();
|
||||
if (path == null || !path.startsWith("/"))
|
||||
return null;
|
||||
return ConvertToHash.getHash(host);
|
||||
}
|
||||
if (host.equals("i2p")) {
|
||||
String path = url.getPath();
|
||||
if (path == null || path.length() < 517 ||
|
||||
@@ -941,6 +950,10 @@ public class TrackerClient implements Runnable {
|
||||
int consecutiveFails;
|
||||
int seenPeers;
|
||||
|
||||
/**
|
||||
* @param a must be a valid http URL with a path
|
||||
* @param p true if primary
|
||||
*/
|
||||
public TCTracker(String a, boolean p)
|
||||
{
|
||||
announce = a;
|
||||
|
||||
@@ -1085,8 +1085,9 @@ public class I2PSnarkServlet extends BasicServlet {
|
||||
// should be only one
|
||||
if (df.delete())
|
||||
_manager.addMessage(_t("Data file deleted: {0}", df.getAbsolutePath()));
|
||||
else
|
||||
else if (df.exists())
|
||||
_manager.addMessage(_t("Data file could not be deleted: {0}", df.getAbsolutePath()));
|
||||
// else already gone
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -1094,8 +1095,9 @@ public class I2PSnarkServlet extends BasicServlet {
|
||||
for (File df : storage.getFiles()) {
|
||||
if (df.delete()) {
|
||||
//_manager.addMessage(_t("Data file deleted: {0}", df.getAbsolutePath()));
|
||||
} else {
|
||||
} else if (df.exists()) {
|
||||
_manager.addMessage(_t("Data file could not be deleted: {0}", df.getAbsolutePath()));
|
||||
// else already gone
|
||||
}
|
||||
}
|
||||
// step 2 delete dirs bottom-up
|
||||
@@ -1109,11 +1111,12 @@ public class I2PSnarkServlet extends BasicServlet {
|
||||
if (df.delete()) {
|
||||
ok = true;
|
||||
//_manager.addMessage(_t("Data dir deleted: {0}", df.getAbsolutePath()));
|
||||
} else {
|
||||
} else if (df.exists()) {
|
||||
ok = false;
|
||||
_manager.addMessage(_t("Directory could not be deleted: {0}", df.getAbsolutePath()));
|
||||
if (_log.shouldLog(Log.WARN))
|
||||
_log.warn("Could not delete dir " + df);
|
||||
// else already gone
|
||||
}
|
||||
}
|
||||
// step 3 message for base (last one)
|
||||
|
||||
@@ -780,7 +780,12 @@ class Packet {
|
||||
if (isFlagSet(FLAG_MAX_PACKET_SIZE_INCLUDED)) buf.append(" MS ").append(_optionMaxSize);
|
||||
if (isFlagSet(FLAG_PROFILE_INTERACTIVE)) buf.append(" INTERACTIVE");
|
||||
if (isFlagSet(FLAG_RESET)) buf.append(" RESET");
|
||||
if (isFlagSet(FLAG_SIGNATURE_INCLUDED)) buf.append(" SIG ").append(_optionSignature.length());
|
||||
if (isFlagSet(FLAG_SIGNATURE_INCLUDED)) {
|
||||
if (_optionSignature != null)
|
||||
buf.append(" SIG ").append(_optionSignature.length());
|
||||
else
|
||||
buf.append(" (to be signed)");
|
||||
}
|
||||
if (isFlagSet(FLAG_SIGNATURE_REQUESTED)) buf.append(" SIGREQ");
|
||||
if (isFlagSet(FLAG_SYNCHRONIZE)) buf.append(" SYN");
|
||||
}
|
||||
|
||||
@@ -1400,6 +1400,7 @@
|
||||
|
||||
<target name="updater200" depends="prepupdate, preplicenses, pack200, zipit200" />
|
||||
<target name="updater200WithJetty" depends="prepjupdate, preplicenses, pack200, zipit200" />
|
||||
<target name="updater200WithJettyAndJbigi" depends="prepjupdate, prepjbigiupdate, preplicenses, pack200, zipit200" />
|
||||
<target name="updater200WithJettyAndGeoIP" depends="prepjupdate, prepgeoupdate, preplicenses, pack200, zipit200" />
|
||||
<target name="updater200WithJettyFixes" depends="prepjupdatefixes, preplicenses, pack200, zipit200" />
|
||||
<target name="updater200WithJettyFixesAndJbigi" depends="prepjupdatefixes, prepjbigiupdate, preplicenses, pack200, zipit200" />
|
||||
@@ -1413,6 +1414,7 @@
|
||||
<target name="updaterWithGeoIP" depends="prepupdate, prepgeoupdate, preplicenses, zipit" />
|
||||
<target name="updaterWithJetty" depends="prepjupdate, preplicenses, zipit" />
|
||||
<target name="updaterWithJettyRepack" depends="prepjupdate, preplicenses, repack200, zipit" />
|
||||
<target name="updaterWithJettyAndJbigiRepack" depends="prepjupdate, prepjbigiupdate, preplicenses, repack200, zipit" />
|
||||
<target name="updaterWithJettyAndGeoIPRepack" depends="prepjupdate, prepgeoupdate, preplicenses, repack200, zipit" />
|
||||
<target name="updaterWithJettyFixes" depends="prepjupdatefixes, preplicenses, zipit" />
|
||||
<target name="updaterWithJettyFixesAndJbigi" depends="prepjupdatefixes, prepjbigiupdate, preplicenses, zipit" />
|
||||
@@ -1915,8 +1917,9 @@
|
||||
<!--
|
||||
<target name="release" depends="distclean, updaterWithJettyFixesAndJbigi , updater200WithJettyFixes, preppkg, installer, getReleaseNumber" >
|
||||
<target name="release" depends="verifyReleaseBuildNumbers, -pre-release, distclean, testscripts, updaterWithJettyAndGeoIPRepack, updater200WithJettyAndGeoIP, delete-j6-update, installer-nowindows, delete-nonwindows, installer-windows">
|
||||
-->
|
||||
<target name="release" depends="verifyReleaseBuildNumbers, -pre-release, distclean, testscripts, updaterWithJettyRepack, updater200WithJetty, delete-j6-update, installer-nowindows, delete-nonwindows, installer-windows">
|
||||
-->
|
||||
<target name="release" depends="verifyReleaseBuildNumbers, -pre-release, distclean, testscripts, updaterWithJettyAndJbigiRepack, updater200WithJettyAndJbigi, delete-j6-update, installer-nowindows, delete-nonwindows, installer-windows">
|
||||
<echo message="New version number is ${release.number}" />
|
||||
<copy file="i2pupdate.zip" tofile="i2pupdate_${release.number}.zip" />
|
||||
<copy file="i2pinstall_${full.version}.jar" tofile="i2pinstall_${release.number}.jar" />
|
||||
|
||||
@@ -640,7 +640,9 @@ public class NativeBigInteger extends BigInteger {
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws ArithmeticException if m <= 0
|
||||
* @param m must be postive
|
||||
* @param exponent must be postive
|
||||
* @throws ArithmeticException if m <= 0 or exponent <=0
|
||||
*/
|
||||
@Override
|
||||
public BigInteger modPow(BigInteger exponent, BigInteger m) {
|
||||
@@ -654,7 +656,9 @@ public class NativeBigInteger extends BigInteger {
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws ArithmeticException if m <= 0
|
||||
* @param exponent must be postive
|
||||
* @param m must be postive and odd
|
||||
* @throws ArithmeticException if m <= 0 or m is even or exponent <=0
|
||||
* @since 0.9.26 and libjbigi version 3 and GMP version 5
|
||||
*/
|
||||
public BigInteger modPowCT(BigInteger exponent, BigInteger m) {
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
2016-08-02 zzz
|
||||
* i2psnark: Fix SIOOBE on bad announce URL (ticket #1823)
|
||||
* SSU: Fix peer test stuck when IPv6-only (ticket #1819)
|
||||
* Streaming: Fix debug NPE (ticket #1821)
|
||||
|
||||
2016-07-20 zzz
|
||||
* SSU:
|
||||
- Increase minimum peers if we have a IPv6 address
|
||||
|
||||
@@ -18,7 +18,7 @@ public class RouterVersion {
|
||||
/** deprecated */
|
||||
public final static String ID = "Monotone";
|
||||
public final static String VERSION = CoreVersion.VERSION;
|
||||
public final static long BUILD = 7;
|
||||
public final static long BUILD = 8;
|
||||
|
||||
/** for example "-test" */
|
||||
public final static String EXTRA = "";
|
||||
|
||||
@@ -3303,7 +3303,7 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
|
||||
locked_runTest(false);
|
||||
} else if (_haveIPv6Address &&_forceRun == FORCE_IPV6 && sinceRunV6 >= MIN_TEST_FREQUENCY) {
|
||||
locked_runTest(true);
|
||||
} else if (sinceRunV4 >= TEST_FREQUENCY) {
|
||||
} else if (sinceRunV4 >= TEST_FREQUENCY && getIPv6Config() != IPV6_ONLY) {
|
||||
locked_runTest(false);
|
||||
} else if (_haveIPv6Address && sinceRunV6 >= TEST_FREQUENCY) {
|
||||
locked_runTest(true);
|
||||
@@ -3316,7 +3316,7 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
|
||||
if (_alive) {
|
||||
long delay = (TEST_FREQUENCY / 2) + _context.random().nextInt(TEST_FREQUENCY);
|
||||
// if we have 2 addresses, give IPv6 a chance also
|
||||
if (_haveIPv6Address)
|
||||
if (_haveIPv6Address && getIPv6Config() != IPV6_ONLY)
|
||||
delay /= 2;
|
||||
schedule(delay);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user