From a2873c42bc35729714dac27f3420af6d553833e9 Mon Sep 17 00:00:00 2001
From: zzz <zzz@mail.i2p>
Date: Wed, 27 Apr 2016 15:48:42 +0000
Subject: [PATCH] i2ptunnel: Fix can't connect error message for servers when
 in router context, like we did for clients earlier

---
 .../java/src/net/i2p/i2ptunnel/I2PTunnelServer.java         | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelServer.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelServer.java
index 3b92172383..c6c8af1730 100644
--- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelServer.java
+++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelServer.java
@@ -243,7 +243,11 @@ public class I2PTunnelServer extends I2PTunnelTask implements Runnable {
                 String portNum = getTunnel().port;
                 if (portNum == null)
                     portNum = "7654";
-                String msg = "Unable to connect to the router at " + getTunnel().host + ':' + portNum +
+                String msg;
+                if (getTunnel().getContext().isRouterContext())
+                    msg = "Unable to build tunnels for the server at " + remoteHost.getHostAddress() + ':' + remotePort;
+                else
+                    msg = "Unable to connect to the router at " + getTunnel().host + ':' + portNum +
                              " and build tunnels for the server at " + remoteHost.getHostAddress() + ':' + remotePort;
                 if (++retries < MAX_RETRIES) {
                     msg += ", retrying in " + (RETRY_DELAY / 1000) + " seconds";
-- 
GitLab