forked from I2P_Developers/i2p.i2p
Fix removal of subsession aliases from tunnel manager on
I2CP connection shutdown Sort tweaks for shared clients in summary bar
This commit is contained in:
@ -491,9 +491,11 @@ public class SummaryHelper extends HelperBase {
|
||||
public int compare(Destination lhs, Destination rhs) {
|
||||
String lname = getName(lhs);
|
||||
String rname = getName(rhs);
|
||||
if (lname.equals(xsc))
|
||||
boolean lshared = lname.startsWith("shared clients") || lname.startsWith(xsc);
|
||||
boolean rshared = rname.startsWith("shared clients") || rname.startsWith(xsc);
|
||||
if (lshared && !rshared)
|
||||
return -1;
|
||||
if (rname.equals(xsc))
|
||||
if (rshared && !lshared)
|
||||
return 1;
|
||||
return Collator.getInstance().compare(lname, rname);
|
||||
}
|
||||
|
@ -202,6 +202,8 @@ class ClientConnectionRunner {
|
||||
LeaseSet ls = sp.currentLeaseSet;
|
||||
if (ls != null)
|
||||
_context.netDb().unpublish(ls);
|
||||
if (!sp.isPrimary)
|
||||
_context.tunnelManager().removeAlias(sp.dest);
|
||||
}
|
||||
synchronized (_alreadyProcessed) {
|
||||
_alreadyProcessed.clear();
|
||||
@ -414,15 +416,21 @@ class ClientConnectionRunner {
|
||||
if (ls != null)
|
||||
_context.netDb().unpublish(ls);
|
||||
isPrimary = sp.isPrimary;
|
||||
if (!isPrimary)
|
||||
_context.tunnelManager().removeAlias(sp.dest);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (isPrimary) {
|
||||
if (isPrimary && !_sessions.isEmpty()) {
|
||||
// kill all the others also
|
||||
for (SessionParams sp : _sessions.values()) {
|
||||
_manager.unregisterSession(id, sp.dest);
|
||||
if (_log.shouldLog(Log.INFO))
|
||||
_log.info("Destroying remaining client subsession " + sp.sessionId);
|
||||
_manager.unregisterSession(sp.sessionId, sp.dest);
|
||||
LeaseSet ls = sp.currentLeaseSet;
|
||||
if (ls != null)
|
||||
_context.netDb().unpublish(ls);
|
||||
_context.tunnelManager().removeAlias(sp.dest);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -220,14 +220,14 @@ class ClientManager {
|
||||
* Remove all sessions for this runner.
|
||||
*/
|
||||
public void unregisterConnection(ClientConnectionRunner runner) {
|
||||
if (_log.shouldLog(Log.WARN))
|
||||
_log.warn("Unregistering (dropping) a client connection");
|
||||
synchronized (_pendingRunners) {
|
||||
_pendingRunners.remove(runner);
|
||||
}
|
||||
|
||||
List<SessionId> ids = runner.getSessionIds();
|
||||
List<Destination> dests = runner.getDestinations();
|
||||
if (_log.shouldLog(Log.WARN))
|
||||
_log.warn("Unregistering (dropping) a client connection with ids: " + ids);
|
||||
synchronized (_runners) {
|
||||
for (SessionId id : ids) {
|
||||
_runnerSessionIds.remove(id);
|
||||
|
@ -426,8 +426,6 @@ class ClientMessageEventListener implements I2CPMessageReader.I2CPMessageEventLi
|
||||
if (left <= 0) {
|
||||
_runner.stopRunning();
|
||||
} else {
|
||||
if (cfg != null)
|
||||
_context.tunnelManager().removeAlias(cfg.getDestination());
|
||||
if (_log.shouldLog(Log.INFO))
|
||||
_log.info("Still " + left + " sessions left");
|
||||
}
|
||||
|
Reference in New Issue
Block a user