Changeset 54fb91b


Ignore:
Timestamp:
Nov 23, 2013 5:54:01 PM (7 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
ffa03f2
Parents:
fdb0097
Message:

I2PTunnel: Call destroySocketManager() when replacing

a client socket manager configured with i2cp.newDestOnResume,
or a shared client.
This prevents lots of orphaned StreamingTimer? threads.
There are still cases where these threads may stick around,
when a tunnel is stopped but not restarted. We don't know in
some cases when a tunnel could be restarted and when it can't.
destroySocketManager() should always be called when discarding a
SocketManager? but i2ptunnel doesn't do that now. More to do,
but this fixes the most common case of leaked threads.
Related tickets: ##642 #961

File:
1 edited

Legend:

Unmodified
Added
Removed
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelClientBase.java

    rfdb0097 r54fb91b  
    264264                    if (_log.shouldLog(Log.WARN))
    265265                        _log.warn(getTunnel().getClientOptions().getProperty("inbound.nickname") + ": Built a new destination on resume");
     266                    // make sure the old one is closed
     267                    sockMgr.destroySocketManager();
    266268                    newManager = true;
    267269                }  // else the old socket manager will reconnect the old session if necessary
     
    321323                    _log.info(tunnel.getClientOptions().getProperty("inbound.nickname") + ": Building a new socket manager since the old one closed [s=" + s + "]");
    322324                tunnel.removeSession(s);
     325                // make sure the old one is closed
     326                socketManager.destroySocketManager();
    323327                // We could be here a LONG time, holding the lock
    324328                socketManager = buildSocketManager(tunnel, pkf);
Note: See TracChangeset for help on using the changeset viewer.