forked from I2P_Developers/i2p.i2p
i2ptunnel: Return error message from IRC client on failure to build tunnels
previously just closed the socket
This commit is contained in:
@@ -137,7 +137,18 @@ public class I2PTunnelIRCClient extends I2PTunnelClientBase {
|
|||||||
if (clientDest == null)
|
if (clientDest == null)
|
||||||
throw new UnknownHostException("Could not resolve " + addr.getHostName());
|
throw new UnknownHostException("Could not resolve " + addr.getHostName());
|
||||||
int port = addr.getPort();
|
int port = addr.getPort();
|
||||||
i2ps = createI2PSocket(clientDest, port);
|
try {
|
||||||
|
i2ps = createI2PSocket(clientDest, port);
|
||||||
|
} catch (RuntimeException re) {
|
||||||
|
// tunnel build failure
|
||||||
|
_log.error("Error connecting", re);
|
||||||
|
try {
|
||||||
|
String name = addr != null ? addr.getHostName() : "undefined";
|
||||||
|
String msg = ":" + name + " 499 you :" + re.getMessage() + "\r\n";
|
||||||
|
s.getOutputStream().write(DataHelper.getUTF8(msg));
|
||||||
|
} catch (IOException ioe) {}
|
||||||
|
throw re;
|
||||||
|
}
|
||||||
i2ps.setReadTimeout(readTimeout);
|
i2ps.setReadTimeout(readTimeout);
|
||||||
StringBuffer expectedPong = new StringBuffer();
|
StringBuffer expectedPong = new StringBuffer();
|
||||||
DCCHelper dcc = _dccEnabled ? new DCC(s.getLocalAddress().getAddress()) : null;
|
DCCHelper dcc = _dccEnabled ? new DCC(s.getLocalAddress().getAddress()) : null;
|
||||||
|
|||||||
Reference in New Issue
Block a user