Skip to content

Commit

Permalink
Transport: Better message on UPnP tab when enabled but fails to start…
Browse files Browse the repository at this point in the history
… (Github i2p#84)
  • Loading branch information
zzzi2p committed Nov 29, 2024
1 parent 37cdade commit 085bbbb
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions router/java/src/net/i2p/router/transport/UPnPManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,11 @@ public synchronized void start() {
// If not, that's why it failed (HTTPServer won't start)
if (!Addresses.isConnected()) {
if (!_disconLogged) {
_log.logAlways(Log.WARN, "UPnP start failed - no network connection?");
_log.logAlways(Log.WARN, _t("UPnP failed to start - no network connection?"));
_disconLogged = true;
}
} else {
_log.error("UPnP start failed - port conflict?");
_log.error(_t("UPnP failed to start - port conflict?"));
}
}
}
Expand Down Expand Up @@ -391,8 +391,14 @@ private void locked_PFS(Map<ForwardPort,ForwardPortStatus> statuses) {
* will take many seconds if it has vanished.
*/
public String renderStatusHTML() {
if (!_isRunning)
return "<h3><a name=\"upnp\"></a>" + _t("UPnP is not enabled") + "</h3>\n";
if (!_isRunning) {
String msg;
if (Addresses.isConnected())
msg = _t("UPnP failed to start - port conflict?");
else
msg = _t("UPnP failed to start - no network connection?");
return "<h3><a name=\"upnp\"></a>" + msg + "</h3>\n";
}
return _upnp.renderStatusHTML();
}

Expand Down

0 comments on commit 085bbbb

Please sign in to comment.