*) adding test for connection status of port forwarding feature

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@292 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
theli 20 years ago
parent bf66c6d6ec
commit aea355c03c

@ -37,7 +37,7 @@ Your settings are protected by a password.
#[version]##(versioncomment)#:: - the latest public version is #[latestVersion]#. Click here to <a href="http://www.yacy.net/yacy/Download.html">download</a> it.#(/versioncomment)# #[version]##(versioncomment)#:: - the latest public version is #[latestVersion]#. Click here to <a href="http://www.yacy.net/yacy/Download.html">download</a> it.#(/versioncomment)#
</td></tr> </td></tr>
<tr class="TableCellDark"><td>Proxy host</td><td>#[host]#:#[port]#</td></tr> <tr class="TableCellDark"><td>Proxy host</td><td>#[host]#:#[port]#</td></tr>
<tr class="TableCellLight"><td>Port forwarding host</td><td>#(portForwarding)#not used::#[host]#:#[port]##(/portForwarding)#</td></tr> <tr class="TableCellLight"><td>Port forwarding host</td><td>#(portForwarding)#not used::#[host]#:#[port]# (#(status)#broken::connected#(/status)#)#(/portForwarding)#</td></tr>
<tr class="TableCellDark"><td>Remote proxy</td><td>#(remoteProxy)#not used::#[host]#:#[port]##(/remoteProxy)#</td></tr> <tr class="TableCellDark"><td>Remote proxy</td><td>#(remoteProxy)#not used::#[host]#:#[port]##(/remoteProxy)#</td></tr>
<tr class="TableCellLight"><td>This peer's address</td><td> <tr class="TableCellLight"><td>This peer's address</td><td>
#(peerAddress)# #(peerAddress)#

@ -92,6 +92,7 @@ public class Status {
prop.put("portForwarding", 1); prop.put("portForwarding", 1);
prop.put("portForwarding_host", serverCore.portForwarding.getHost()); prop.put("portForwarding_host", serverCore.portForwarding.getHost());
prop.put("portForwarding_port", Integer.toString(serverCore.portForwarding.getPort())); prop.put("portForwarding_port", Integer.toString(serverCore.portForwarding.getPort()));
prop.put("portForwarding_status", serverCore.portForwarding.isConnected() ? 1:0);
} else { } else {
prop.put("portForwarding", 0); prop.put("portForwarding", 0);
} }

@ -18,4 +18,5 @@ public interface serverPortForwarding {
public void connect() throws IOException; public void connect() throws IOException;
public void disconnect() throws IOException; public void disconnect() throws IOException;
public boolean isConnected();
} }

@ -100,6 +100,11 @@ public class serverPortForwardingSch implements serverPortForwarding{
} }
} }
public boolean isConnected() {
if (this.session == null) return false;
return this.session.isConnected();
}
class MyUserInfo class MyUserInfo
implements UserInfo, UIKeyboardInteractive { implements UserInfo, UIKeyboardInteractive {
String passwd; String passwd;

Loading…
Cancel
Save