diff --git a/apps/httptunnel/java/src/net/i2p/httptunnel/handler/EepHandler.java b/apps/httptunnel/java/src/net/i2p/httptunnel/handler/EepHandler.java index 001489918..1535d2915 100644 --- a/apps/httptunnel/java/src/net/i2p/httptunnel/handler/EepHandler.java +++ b/apps/httptunnel/java/src/net/i2p/httptunnel/handler/EepHandler.java @@ -101,9 +101,6 @@ public class EepHandler { } catch (IOException ex) { _log.error("Error while handling eepsite request"); return written; - } catch (InterruptedException ex) { - _log.error("Error while handling eepsite request"); - return written; } catch (I2PException ex) { _log.error("Error while handling eepsite request"); return written; diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelClient.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelClient.java index 46588cfd7..ab0913695 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelClient.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelClient.java @@ -52,7 +52,6 @@ public class I2PTunnelClient extends I2PTunnelClientBase { } catch (Exception ex) { _log.info("Error connecting", ex); l.log(ex.getMessage()); - // s has been initialized before the try block... closeSocket(s); } } diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelClientBase.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelClientBase.java index 43bef4e26..d5efeb4c7 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelClientBase.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelClientBase.java @@ -4,6 +4,7 @@ package net.i2p.i2ptunnel; import java.io.IOException; +import java.io.InterruptedIOException; import java.net.ConnectException; import java.net.InetAddress; import java.net.NoRouteToHostException; @@ -157,7 +158,7 @@ public abstract class I2PTunnelClientBase extends I2PTunnelTask implements Runna * @param dest The destination to connect to * @return a new I2PSocket */ - public I2PSocket createI2PSocket(Destination dest) throws I2PException, ConnectException, NoRouteToHostException, InterruptedException { + public I2PSocket createI2PSocket(Destination dest) throws I2PException, ConnectException, NoRouteToHostException, InterruptedIOException { return createI2PSocket(dest, getDefaultOptions()); } @@ -172,10 +173,10 @@ public abstract class I2PTunnelClientBase extends I2PTunnelTask implements Runna * * @throws ConnectException if the peer refuses the connection * @throws NoRouteToHostException if the peer is not found or not reachable - * @throws InterruptedException if the connection timeouts + * @throws InterruptedIOException if the connection timeouts * @throws I2PException if there is some other I2P-related problem */ - public I2PSocket createI2PSocket(Destination dest, I2PSocketOptions opt) throws I2PException, ConnectException, NoRouteToHostException, InterruptedException { + public I2PSocket createI2PSocket(Destination dest, I2PSocketOptions opt) throws I2PException, ConnectException, NoRouteToHostException, InterruptedIOException { I2PSocket i2ps; synchronized (sockLock) { diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java index 47a8c8aba..de43355a7 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java @@ -201,12 +201,6 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable l.log(ex.getMessage()); handleHTTPClientException(ex, out, targetRequest, usingWWWProxy, wwwProxy); closeSocket(s); - } catch (InterruptedException ex) { - if (timeoutThread != null) timeoutThread.disable(); - _log.info("Error trying to connect", ex); - l.log(ex.getMessage()); - handleHTTPClientException(ex, out, targetRequest, usingWWWProxy, wwwProxy); - closeSocket(s); } catch (I2PException ex) { if (timeoutThread != null) timeoutThread.disable(); _log.info("Error trying to connect", ex); diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/socks/SOCKSServer.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/socks/SOCKSServer.java index c150e84ca..cc2fcf1ab 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/socks/SOCKSServer.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/socks/SOCKSServer.java @@ -96,9 +96,6 @@ public abstract class SOCKSServer { } catch (IOException e) { throw new SOCKSException("Error connecting (" + e.getMessage() + ")"); - } catch (InterruptedException e) { - throw new SOCKSException("Error connecting (" - + e.getMessage() + ")"); } catch (I2PException e) { throw new SOCKSException("Error connecting (" + e.getMessage() + ")"); diff --git a/apps/sam/java/src/net/i2p/sam/SAMStreamSession.java b/apps/sam/java/src/net/i2p/sam/SAMStreamSession.java index ff9a1bc00..39e17006d 100644 --- a/apps/sam/java/src/net/i2p/sam/SAMStreamSession.java +++ b/apps/sam/java/src/net/i2p/sam/SAMStreamSession.java @@ -12,6 +12,7 @@ import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.InputStream; import java.io.IOException; +import java.io.InterruptedIOException; import java.util.HashMap; import java.io.OutputStream; import java.net.ConnectException; @@ -151,10 +152,10 @@ public class SAMStreamSession { * receive-only session * @throws ConnectException if the destination refuses connections * @throws NoRouteToHostException if the destination can't be reached - * @throws InterruptedException if the connection timeouts + * @throws InterruptedIOException if the connection timeouts * @throws I2PException if there's another I2P-related error */ - public boolean connect(int id, String dest, Properties props) throws I2PException, ConnectException, NoRouteToHostException, DataFormatException, InterruptedException, SAMInvalidDirectionException { + public boolean connect(int id, String dest, Properties props) throws I2PException, ConnectException, NoRouteToHostException, DataFormatException, InterruptedIOException, SAMInvalidDirectionException { if (!canCreate) { _log.debug("Trying to create an outgoing connection using a receive-only session"); throw new SAMInvalidDirectionException("Trying to create connections through a receive-only session"); diff --git a/apps/sam/java/src/net/i2p/sam/SAMv1Handler.java b/apps/sam/java/src/net/i2p/sam/SAMv1Handler.java index b33c12943..44c975cbe 100644 --- a/apps/sam/java/src/net/i2p/sam/SAMv1Handler.java +++ b/apps/sam/java/src/net/i2p/sam/SAMv1Handler.java @@ -14,6 +14,7 @@ import java.io.DataInputStream; import java.io.EOFException; import java.io.InputStream; import java.io.IOException; +import java.io.InterruptedIOException; import java.io.OutputStream; import java.io.UnsupportedEncodingException; import java.net.Socket; @@ -598,7 +599,7 @@ public class SAMv1Handler extends SAMHandler implements SAMRawReceiver, SAMDatag _log.debug("STREAM CONNECT failed: " + e.getMessage()); return writeString("STREAM STATUS RESULT=CANT_REACH_PEER ID=" + id + "\n"); - } catch (InterruptedException e) { + } catch (InterruptedIOException e) { _log.debug("STREAM CONNECT failed: " + e.getMessage()); return writeString("STREAM STATUS RESULT=TIMEOUT ID=" + id + "\n");