forked from I2P_Developers/i2p.i2p
Compare commits
4 Commits
abbda43e84
...
6f9871e344
Author | SHA1 | Date | |
---|---|---|---|
![]() |
6f9871e344 | ||
![]() |
0da4cf49c1 | ||
![]() |
3490a1a6ec | ||
![]() |
0bd60989de |
@@ -182,6 +182,7 @@ class Daemon {
|
||||
long start = DEBUG ? System.currentTimeMillis() : 0;
|
||||
int old = 0, nnew = 0, invalid = 0, conflict = 0, total = 0;
|
||||
int deleted = 0;
|
||||
String newname = null;
|
||||
while(iter.hasNext()) {
|
||||
Map.Entry<String, HostTxtEntry> entry = iter.next();
|
||||
total++;
|
||||
@@ -280,6 +281,8 @@ class Daemon {
|
||||
if (log != null && !success)
|
||||
log.append("Add to published address book " + publishedNS.getName() + " failed for " + key);
|
||||
}
|
||||
if (nnew == 0)
|
||||
newname = key;
|
||||
nnew++;
|
||||
continue;
|
||||
} else {
|
||||
@@ -503,6 +506,8 @@ class Daemon {
|
||||
// keep track for later dup check
|
||||
knownNames.add(key);
|
||||
}
|
||||
if (nnew == 0)
|
||||
newname = key;
|
||||
nnew++;
|
||||
} else if (key == null) {
|
||||
// 'remove' actions
|
||||
@@ -677,6 +682,8 @@ class Daemon {
|
||||
if (cmgr != null) {
|
||||
int nc = cmgr.getBubbleCount(PortMapper.SVC_SUSIDNS) + nnew;
|
||||
String msg = ngettext("{0} new host", "{0} new hosts", nc);
|
||||
if (nc == 1)
|
||||
msg += ": " + newname;
|
||||
cmgr.setBubble(PortMapper.SVC_SUSIDNS, nc, msg);
|
||||
}
|
||||
}
|
||||
|
@@ -36,6 +36,7 @@ import net.i2p.util.FileSuffixFilter;
|
||||
import net.i2p.util.FileUtil;
|
||||
import net.i2p.util.I2PAppThread;
|
||||
import net.i2p.util.Log;
|
||||
import net.i2p.util.OrderedProperties;
|
||||
import net.i2p.util.PortMapper;
|
||||
import net.i2p.util.SimpleTimer2;
|
||||
import net.i2p.util.SystemVersion;
|
||||
@@ -804,6 +805,11 @@ public class PluginStarter implements Runnable {
|
||||
* plugins.config
|
||||
*/
|
||||
public static void storePluginProperties(Properties props) {
|
||||
if (!(props instanceof OrderedProperties)) {
|
||||
Properties p = new OrderedProperties();
|
||||
p.putAll(props);
|
||||
props = p;
|
||||
}
|
||||
File cfgFile = new File(I2PAppContext.getGlobalContext().getConfigDir(), CONFIG_FILE);
|
||||
try {
|
||||
DataHelper.storeProps(props, cfgFile);
|
||||
|
@@ -261,8 +261,10 @@ public class RouterAppManager extends ClientAppManagerImpl {
|
||||
* @since 0.9.66
|
||||
*/
|
||||
@Override
|
||||
public synchronized void addBubble(String svc, String text) {
|
||||
setBubble(svc, getBubbleCount(svc) + 1, text);
|
||||
public void addBubble(String svc, String text) {
|
||||
synchronized(_bubbles) {
|
||||
setBubble(svc, getBubbleCount(svc) + 1, text);
|
||||
}
|
||||
}
|
||||
|
||||
/// end ClientAppManager interface
|
||||
|
@@ -304,7 +304,17 @@ class InboundEstablishState extends EstablishBase implements NTCP2Payload.Payloa
|
||||
}
|
||||
// fast MSB check for key < 2^255
|
||||
if ((_X[KEY_SIZE - 1] & 0x80) != 0) {
|
||||
fail("Bad PK msg 1");
|
||||
// same probing resistance strategy as below
|
||||
_padlen1 = _context.random().nextInt(PADDING1_FAIL_MAX) - src.remaining();
|
||||
if (_padlen1 > 0) {
|
||||
if (_log.shouldWarn())
|
||||
_log.warn("Bad PK msg 1, X = " + Base64.encode(_X, 0, KEY_SIZE) + " with " + src.remaining() +
|
||||
" more bytes, waiting for " + _padlen1 + " more bytes");
|
||||
changeState(State.IB_NTCP2_READ_RANDOM);
|
||||
} else {
|
||||
fail("Bad PK msg 1, X = " + Base64.encode(_X, 0, KEY_SIZE) + " remaining = " + src.remaining());
|
||||
}
|
||||
_transport.getPumper().blockIP(_con.getRemoteIP());
|
||||
return;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user