forked from I2P_Developers/i2p.i2p
Router: Fix corner cases maintaining local leasesets (ticket #1768)
This commit is contained in:
@ -1,3 +1,10 @@
|
||||
2016-03-14 zzz
|
||||
* Console: Replace pastethis with zerobin
|
||||
* Peer selection: Don't truncate data used for random slice
|
||||
* Router: Fix corner cases maintaining local leasesets (ticket #1768)
|
||||
* Susimail: Fix NPE
|
||||
* UPnP: Fix NPE in HTML output on /peers (ticket #1779)
|
||||
|
||||
2016-03-01 zzz
|
||||
* i2psnark: Fix handling of HAVE messages received before metainfo
|
||||
* i2ptunnel: Don't default to a private key file that exists (ticket #1628)
|
||||
|
@ -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 = 11;
|
||||
public final static long BUILD = 12;
|
||||
|
||||
/** for example "-test" */
|
||||
public final static String EXTRA = "-rc";
|
||||
|
@ -292,6 +292,7 @@ class ClientConnectionRunner {
|
||||
* Currently allocated leaseSet.
|
||||
* IS subsession aware.
|
||||
*/
|
||||
/****
|
||||
void setLeaseSet(LeaseSet ls) {
|
||||
Hash h = ls.getDestination().calculateHash();
|
||||
SessionParams sp = _sessions.get(h);
|
||||
@ -299,6 +300,7 @@ class ClientConnectionRunner {
|
||||
return;
|
||||
sp.currentLeaseSet = ls;
|
||||
}
|
||||
****/
|
||||
|
||||
/**
|
||||
* Equivalent to getConfig().getDestination().calculateHash();
|
||||
@ -590,14 +592,16 @@ class ClientConnectionRunner {
|
||||
return;
|
||||
LeaseRequestState state;
|
||||
synchronized (this) {
|
||||
sp.currentLeaseSet = ls;
|
||||
state = sp.leaseRequest;
|
||||
if (state == null) {
|
||||
// We got the LS after the timeout?
|
||||
// ClientMessageEventListener told the router to publish.
|
||||
if (_log.shouldLog(Log.WARN))
|
||||
_log.warn("LeaseRequest is null and we've received a new lease?! perhaps this is odd... " + ls);
|
||||
_log.warn("LeaseRequest is null and we've received a new lease? " + ls);
|
||||
return;
|
||||
} else {
|
||||
state.setIsSuccessful(true);
|
||||
setLeaseSet(ls);
|
||||
if (_log.shouldLog(Log.DEBUG))
|
||||
_log.debug("LeaseSet created fully: " + state + " / " + ls);
|
||||
sp.leaseRequest = null;
|
||||
@ -1071,7 +1075,7 @@ class ClientConnectionRunner {
|
||||
synchronized (_alreadyProcessed) {
|
||||
inLock = _context.clock().now();
|
||||
if (_alreadyProcessed.contains(_messageId)) {
|
||||
_log.warn("Status already updated");
|
||||
_log.info("Status already updated");
|
||||
alreadyProcessed = true;
|
||||
} else {
|
||||
_alreadyProcessed.add(_messageId);
|
||||
|
@ -13,6 +13,7 @@ import java.io.Writer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
@ -236,6 +237,17 @@ class ClientManager {
|
||||
_runners.remove(dest);
|
||||
_runnersByHash.remove(dest.calculateHash());
|
||||
}
|
||||
// just in case
|
||||
for (Iterator<ClientConnectionRunner> iter = _runners.values().iterator(); iter.hasNext(); ) {
|
||||
ClientConnectionRunner r = iter.next();
|
||||
if (r.equals(runner))
|
||||
iter.remove();
|
||||
}
|
||||
for (Iterator<ClientConnectionRunner> iter = _runnersByHash.values().iterator(); iter.hasNext(); ) {
|
||||
ClientConnectionRunner r = iter.next();
|
||||
if (r.equals(runner))
|
||||
iter.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -65,8 +65,10 @@ class RequestLeaseSetJob extends JobImpl {
|
||||
endTime += fudge;
|
||||
|
||||
SessionId id = _runner.getSessionId(requested.getDestination().calculateHash());
|
||||
if (id == null)
|
||||
if (id == null) {
|
||||
_runner.failLeaseRequest(_requestState);
|
||||
return;
|
||||
}
|
||||
I2CPMessage msg;
|
||||
if (getContext().getProperty(PROP_VARIABLE, DFLT_VARIABLE) &&
|
||||
(_runner instanceof QueuedClientConnectionRunner ||
|
||||
|
Reference in New Issue
Block a user