i2psnark: Don't mark torrent BAD on I2CP errors (ticket #2725)

Logging:
 - Log to wrapper log after log manager shutdown (ticket #2725)
 - sync methods
Router:
 - Allow clients more time to get disconnect messages at shutdown (ticket #2725)
 - Don't delete router context at shutdown, to prevent a late
   creation of a new app context (ticket #2725)
 - Don't try to delete ping file on Android
javadocs
This commit is contained in:
zzz
2020-04-24 12:44:17 +00:00
parent f2f6dfbf18
commit a7de9a7f24
6 changed files with 119 additions and 22 deletions

View File

@@ -1659,8 +1659,9 @@ public class SnarkManager implements CompleteListener, ClientApp {
disableTorrentFile(filename);
return false;
} catch (OutOfMemoryError oom) {
addMessage(_t("ERROR - Out of memory, cannot create torrent from {0}", sfile.getName()) + ": " + oom.getLocalizedMessage());
return false;
String s = _t("ERROR - Out of memory, cannot create torrent from {0}", sfile.getName()) + ": " + oom.getLocalizedMessage();
addMessage(s);
throw new Snark.RouterException(s, oom);
} finally {
if (fis != null) try { fis.close(); } catch (IOException ioe) {}
}
@@ -2734,6 +2735,10 @@ public class SnarkManager implements CompleteListener, ClientApp {
disableTorrentFile(name);
rv = false;
}
} catch (Snark.RouterException e) {
addMessage(_t("Error: Could not add the torrent {0}", name) + ": " + e);
_log.error("Unable to add the torrent " + name, e);
return false;
} catch (RuntimeException e) {
addMessage(_t("Error: Could not add the torrent {0}", name) + ": " + e);
_log.error("Unable to add the torrent " + name, e);