- Delay during StopAll so we don't close the tunnel before the
stopped announces go out and reopen it - Logging tweaks
This commit is contained in:
@ -152,6 +152,9 @@ public class I2PSnarkUtil {
|
||||
*/
|
||||
synchronized public boolean connect() {
|
||||
if (_manager == null) {
|
||||
// try to find why reconnecting after stop
|
||||
if (_log.shouldLog(Log.DEBUG))
|
||||
_log.debug("Connecting to I2P", new Exception("I did it"));
|
||||
Properties opts = new Properties();
|
||||
if (_opts != null) {
|
||||
for (Iterator iter = _opts.keySet().iterator(); iter.hasNext(); ) {
|
||||
|
@ -268,7 +268,7 @@ public class TrackerClient extends I2PAppThread
|
||||
List ordered = new ArrayList(peers);
|
||||
Collections.shuffle(ordered, r);
|
||||
Iterator it = ordered.iterator();
|
||||
while (it.hasNext()) {
|
||||
while ((!stop) && it.hasNext()) {
|
||||
Peer cur = (Peer)it.next();
|
||||
// FIXME if id == us || dest == us continue;
|
||||
// only delay if we actually make an attempt to add peer
|
||||
|
@ -530,6 +530,8 @@ public class I2PSnarkServlet extends Default {
|
||||
_manager.stopTorrent(snark.torrent, false);
|
||||
}
|
||||
if (_manager.util().connected()) {
|
||||
// Give the stopped announces time to get out
|
||||
try { Thread.sleep(2000); } catch (InterruptedException ie) {}
|
||||
_manager.util().disconnect();
|
||||
_manager.addMessage(_("I2P tunnel closed."));
|
||||
}
|
||||
|
Reference in New Issue
Block a user