1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-24 17:35:35 +02:00

[186761] make the port setting configurable for Telnet and SSH

This commit is contained in:
Martin Oberhuber 2007-07-04 16:21:48 +00:00
parent 5c37f38a3d
commit a98b1c2a0c
4 changed files with 25 additions and 10 deletions

View file

@ -2,7 +2,7 @@
<feature
id="org.eclipse.rse.ssh"
label="%featureName"
version="2.0.0.qualifier"
version="2.0.1.qualifier"
provider-name="%providerName"
plugin="org.eclipse.rse.services.ssh">

View file

@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.rse.connectorservice.ssh; singleton:=true
Bundle-Version: 2.0.0.qualifier
Bundle-Version: 2.0.1.qualifier
Bundle-Activator: org.eclipse.rse.internal.connectorservice.ssh.Activator
Bundle-Vendor: %providerName
Bundle-Localization: plugin

View file

@ -11,6 +11,7 @@
* Martin Oberhuber (Wind River) - [175686] Adapted to new IJSchService API
* - copied code from org.eclipse.team.cvs.ssh2/JSchSession (Copyright IBM)
* Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
* Martin Oberhuber (Wind River) - [186761] make the port setting configurable
*******************************************************************************/
package org.eclipse.rse.internal.connectorservice.ssh;
@ -61,11 +62,7 @@ public class SshConnectorService extends StandardConnectorService implements ISs
private SessionLostHandler fSessionLostHandler;
public SshConnectorService(IHost host) {
//TODO the port parameter doesnt really make sense here since
//it will be overridden when the subsystem initializes (through
//setPort() on our base class -- I assume the port is meant to
//be a local port.
super(SshConnectorResources.SshConnectorService_Name, SshConnectorResources.SshConnectorService_Description, host, 0);
super(SshConnectorResources.SshConnectorService_Name, SshConnectorResources.SshConnectorService_Description, host, SSH_DEFAULT_PORT);
fSessionLostHandler = null;
}
@ -94,6 +91,14 @@ public class SshConnectorService extends StandardConnectorService implements ISs
// </copied code from org.eclipse.team.cvs.ssh2/JSchSession (Copyright IBM)>
//----------------------------------------------------------------------
protected int getSshPort() {
int port = getPort();
if (port<=0) {
//Legacy "default port" setting
port = SSH_DEFAULT_PORT;
}
return port;
}
protected void internalConnect(IProgressMonitor monitor) throws Exception
{
@ -108,7 +113,7 @@ public class SshConnectorService extends StandardConnectorService implements ISs
userInfo.aboutToConnect();
try {
session = createSession(user, password, host, SSH_DEFAULT_PORT,
session = createSession(user, password, host, getSshPort(),
userInfo, monitor);
//java.util.Hashtable config=new java.util.Hashtable();

View file

@ -16,6 +16,7 @@
* Martin Oberhuber (Wind River) - [187218] Fix error reporting for connect()
* Sheldon D'souza (Celunite) - [187301] support multiple telnet shells
* Sheldon D'souza (Celunite) - [194464] fix create multiple telnet shells quickly
* Martin Oberhuber (Wind River) - [186761] make the port setting configurable
*******************************************************************************/
package org.eclipse.rse.internal.connectorservice.telnet;
@ -77,7 +78,7 @@ public class TelnetConnectorService extends StandardConnectorService implements
public TelnetConnectorService(IHost host) {
super(TelnetConnectorResources.TelnetConnectorService_Name,
TelnetConnectorResources.TelnetConnectorService_Description,
host, 0);
host, TELNET_DEFAULT_PORT);
fSessionLostHandler = null;
telnetPropertySet = getTelnetPropertySet();
}
@ -132,6 +133,15 @@ public class TelnetConnectorService extends StandardConnectorService implements
}
}
protected int getTelnetPort() {
int port = getPort();
if (port<=0) {
//Legacy "default port" setting
port = TELNET_DEFAULT_PORT;
}
return port;
}
public TelnetClient makeNewTelnetClient( IProgressMonitor monitor ) throws Exception {
TelnetClient client = new TelnetClient();
String host = getHostName();
@ -141,7 +151,7 @@ public class TelnetConnectorService extends StandardConnectorService implements
Exception nestedException = null;
try {
Activator.trace("Telnet Service: Connecting....."); //$NON-NLS-1$
client.connect(host, TELNET_DEFAULT_PORT);
client.connect(host, getTelnetPort());
SystemSignonInformation ssi = getSignonInformation();
if (ssi != null) {
password = ssi.getPassword();