I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 06e1305d authored by zzz's avatar zzz
Browse files
parent e7bccb2f
No related branches found
No related tags found
No related merge requests found
...@@ -134,9 +134,11 @@ public class I2CPMessageReader { ...@@ -134,9 +134,11 @@ public class I2CPMessageReader {
public void cancelRunner() { public void cancelRunner() {
_doRun = false; _doRun = false;
_stayAlive = false; _stayAlive = false;
if (_stream != null) { // prevent race NPE
InputStream in = _stream;
if (in != null) {
try { try {
_stream.close(); in.close();
} catch (IOException ioe) { } catch (IOException ioe) {
_log.error("Error closing the stream", ioe); _log.error("Error closing the stream", ioe);
} }
...@@ -164,6 +166,7 @@ public class I2CPMessageReader { ...@@ -164,6 +166,7 @@ public class I2CPMessageReader {
_listener.disconnected(I2CPMessageReader.this); _listener.disconnected(I2CPMessageReader.this);
cancelRunner(); cancelRunner();
} catch (OutOfMemoryError oom) { } catch (OutOfMemoryError oom) {
// ooms seen here... maybe log and keep going?
throw oom; throw oom;
} catch (Exception e) { } catch (Exception e) {
_log.log(Log.CRIT, "Unhandled error reading I2CP stream", e); _log.log(Log.CRIT, "Unhandled error reading I2CP stream", e);
...@@ -182,4 +185,4 @@ public class I2CPMessageReader { ...@@ -182,4 +185,4 @@ public class I2CPMessageReader {
// boom bye bye bad bwoy // boom bye bye bad bwoy
} }
} }
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment