2005-12-27 jrandom

* Add a new Status: line on the router console - "ERR-ClockSkew", in case
      the clock is too skewed to do anything useful (check the year and month,
      not just the hour and minute).
    * Fixed the read/write timeouts in the streaming lib (so that it actually
      honors them now)
    * Minor I2PSnark cleanups (no read timeout, more careful shutdown and
      torrent closing)
    * Handle an oddball tunnel creation failure (thanks Xunk)
This commit is contained in:
jrandom
2005-12-27 13:20:50 +00:00
committed by zzz
parent 9b7e5d1817
commit 1d0d0d9c69
11 changed files with 63 additions and 22 deletions

View File

@ -96,8 +96,8 @@ public class I2PSnarkUtil {
opts.setProperty("i2p.streaming.inactivityAction", "1");
if (opts.getProperty("i2p.streaming.writeTimeout") == null)
opts.setProperty("i2p.streaming.writeTimeout", "90000");
if (opts.getProperty("i2p.streaming.readTimeout") == null)
opts.setProperty("i2p.streaming.readTimeout", "90000");
//if (opts.getProperty("i2p.streaming.readTimeout") == null)
// opts.setProperty("i2p.streaming.readTimeout", "120000");
_manager = I2PSocketManagerFactory.createManager(_i2cpHost, _i2cpPort, opts);
}
return (_manager != null);

View File

@ -411,15 +411,23 @@ public class Snark
*/
public void stopTorrent() {
stopped = true;
trackerclient.halt();
coordinator.halt();
try {
storage.close();
} catch (IOException ioe) {
System.out.println("Error closing " + torrent);
ioe.printStackTrace();
TrackerClient tc = trackerclient;
if (tc != null)
tc.halt();
PeerCoordinator pc = coordinator;
if (pc != null)
pc.halt();
Storage st = storage;
if (st != null) {
try {
storage.close();
} catch (IOException ioe) {
System.out.println("Error closing " + torrent);
ioe.printStackTrace();
}
}
PeerCoordinatorSet.instance().remove(coordinator);
if (pc != null)
PeerCoordinatorSet.instance().remove(pc);
}
static Snark parseArguments(String[] args)

View File

@ -199,7 +199,9 @@ public class I2PSnarkServlet extends HttpServlet {
List files = snark.meta.getFiles();
String dataFile = snark.meta.getName();
for (int i = 0; files != null && i < files.size(); i++) {
File df = new File(_manager.getDataDir(), (String)files.get(i));
// multifile torrents have the getFiles() return lists of lists of filenames, but
// each of those lists just contain a single file afaict...
File df = new File(_manager.getDataDir(), files.get(i).toString());
boolean deleted = FileUtil.rmdir(df, false);
if (deleted)
_manager.addMessage("Data dir deleted: " + df.getAbsolutePath());