- 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:
zzz
2010-10-30 15:30:14 +00:00
parent 643687472a
commit f170baab3f
3 changed files with 6 additions and 1 deletions

View File

@ -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(); ) {

View File

@ -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

View File

@ -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."));
}