2005-12-18 jrandom

* Added a standalone runner for the I2PSnark web ui (build with the
      command "ant i2psnark", unzip i2psnark-standalone.zip somewhere, run
      with "java -jar launch-i2psnark.jar", and go to http://localhost:8002/).
    * Further I2PSnark error handling
This commit is contained in:
jrandom
2005-12-18 05:39:52 +00:00
committed by zzz
parent ee0951b5b2
commit c287bace0f
13 changed files with 268 additions and 14 deletions

View File

@@ -62,13 +62,13 @@ class PeerConnectionOut implements Runnable
{
try
{
while (!quit)
while (!quit && peer.isConnected())
{
Message m = null;
PeerState state = null;
synchronized(sendQueue)
{
while (!quit && sendQueue.isEmpty())
while (!quit && peer.isConnected() && sendQueue.isEmpty())
{
try
{
@@ -86,7 +86,7 @@ class PeerConnectionOut implements Runnable
}
}
state = peer.state;
if (!quit && state != null)
if (!quit && state != null && peer.isConnected())
{
// Piece messages are big. So if there are other
// (control) messages make sure they are send first.
@@ -149,8 +149,9 @@ class PeerConnectionOut implements Runnable
}
catch (Throwable t)
{
Snark.debug(peer + ": " + t, Snark.ERROR);
t.printStackTrace();
I2PSnarkUtil.instance().debug(peer.toString(), Snark.ERROR, t);
if (t instanceof OutOfMemoryError)
throw (OutOfMemoryError)t;
}
finally
{