Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 92133 Details for
Bug 222178
[SSH2] decreasing the "keep alive" time for reusing the ssh session.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
This patch will allow users to control the interval for keep-alive
patch.txt (text/plain), 9.60 KB, created by
Atsuhiko Yamanaka
on 2008-03-11 04:29:45 EDT
(
hide
)
Description:
This patch will allow users to control the interval for keep-alive
Filename:
MIME Type:
Creator:
Atsuhiko Yamanaka
Created:
2008-03-11 04:29:45 EDT
Size:
9.60 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jsch.core >Index: src/org/eclipse/jsch/internal/core/ResponsiveSocketFactory.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/ResponsiveSocketFactory.java,v >retrieving revision 1.2 >diff -u -r1.2 ResponsiveSocketFactory.java >--- src/org/eclipse/jsch/internal/core/ResponsiveSocketFactory.java 15 Mar 2007 18:29:14 -0000 1.2 >+++ src/org/eclipse/jsch/internal/core/ResponsiveSocketFactory.java 11 Mar 2008 07:58:30 -0000 >@@ -50,8 +50,6 @@ > // Null out the monitor so we don't hold onto anything > // (i.e. the SSH2 session will keep a handle to the socket factory around > monitor = new NullProgressMonitor(); >- // Set the socket timeout >- socket.setSoTimeout(timeout); > return socket; > } > >Index: src/org/eclipse/jsch/internal/core/Utils.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/Utils.java,v >retrieving revision 1.9 >diff -u -r1.9 Utils.java >--- src/org/eclipse/jsch/internal/core/Utils.java 2 Nov 2007 07:15:49 -0000 1.9 >+++ src/org/eclipse/jsch/internal/core/Utils.java 11 Mar 2008 07:58:30 -0000 >@@ -80,6 +80,23 @@ > config.put("PreferredAuthentications", //$NON-NLS-1$ > "gssapi-with-mic,publickey,password,keyboard-interactive"); //$NON-NLS-1$ > session.setConfig(config); >+ >+ Preferences preferences=JSchCorePlugin.getPlugin().getPluginPreferences(); >+ String _interval=preferences.getString(IConstants.KEY_SERVERALIVEINTERVAL); >+ try{ >+ int interval=Integer.parseInt(_interval); >+ if(interval!=0){ >+ session.setServerAliveInterval(interval*1000); >+ session.setServerAliveCountMax(3); >+ } >+ else{ >+ session.setServerAliveCountMax(0); >+ } >+ } >+ catch(NumberFormatException e){ >+ // This exception must not be thrown. >+ } >+ > return session; > } > >Index: src/org/eclipse/jsch/internal/core/IConstants.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/IConstants.java,v >retrieving revision 1.2 >diff -u -r1.2 IConstants.java >--- src/org/eclipse/jsch/internal/core/IConstants.java 13 Apr 2007 15:00:30 -0000 1.2 >+++ src/org/eclipse/jsch/internal/core/IConstants.java 11 Mar 2008 07:58:30 -0000 >@@ -28,6 +28,7 @@ > > public static final String KEY_SSH2HOME="SSH2HOME"; //$NON-NLS-1$ > public static final String KEY_PRIVATEKEY="PRIVATEKEY"; //$NON-NLS-1$ >+ public static final String KEY_SERVERALIVEINTERVAL="SERVERALIVEINTERVAL"; //$NON-NLS-1$ > > public static final String PROXY_TYPE_SOCKS5="SOCKS5"; //$NON-NLS-1$ > public static final String PROXY_TYPE_HTTP="HTTP"; //$NON-NLS-1$ >@@ -40,6 +41,9 @@ > > public static final int SSH_DEFAULT_PORT=22; > >+ public static final String SERVERALIVEINTERVAL_DEFAULT="0"; //$NON-NLS-1$ >+ >+ > public final String PREF_USE_PROXY="proxyEnabled"; //$NON-NLS-1$ > public final String PREF_PROXY_TYPE="proxyType"; //$NON-NLS-1$ > public final String PREF_PROXY_HOST="proxyHost"; //$NON-NLS-1$ >Index: src/org/eclipse/jsch/internal/core/JSchProvider.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/JSchProvider.java,v >retrieving revision 1.4 >diff -u -r1.4 JSchProvider.java >--- src/org/eclipse/jsch/internal/core/JSchProvider.java 7 Feb 2008 02:36:51 -0000 1.4 >+++ src/org/eclipse/jsch/internal/core/JSchProvider.java 11 Mar 2008 07:58:30 -0000 >@@ -105,7 +105,6 @@ > int port=session.getPort(); > session=Utils.createSession(getJSch(), user, host, port); > session.setUserInfo(ui); >- session.setTimeout(timeout); > connect(session, timeout, monitor); > return; > } >Index: src/org/eclipse/jsch/internal/core/PreferenceInitializer.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/PreferenceInitializer.java,v >retrieving revision 1.3 >diff -u -r1.3 PreferenceInitializer.java >--- src/org/eclipse/jsch/internal/core/PreferenceInitializer.java 13 Apr 2007 15:00:30 -0000 1.3 >+++ src/org/eclipse/jsch/internal/core/PreferenceInitializer.java 11 Mar 2008 07:58:30 -0000 >@@ -34,6 +34,7 @@ > IEclipsePreferences defaultNode=new DefaultScope().getNode(JSchCorePlugin.ID); > defaultNode.put(IConstants.KEY_SSH2HOME, SSH_HOME_DEFAULT); > defaultNode.put(IConstants.KEY_PRIVATEKEY, IConstants.PRIVATE_KEYS_DEFAULT); >+ defaultNode.put(IConstants.KEY_SERVERALIVEINTERVAL, IConstants.SERVERALIVEINTERVAL_DEFAULT); > Utils.migrateSSH2Preferences(); > } > >#P org.eclipse.jsch.ui >Index: src/org/eclipse/jsch/internal/ui/messages.properties >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jsch.ui/src/org/eclipse/jsch/internal/ui/messages.properties,v >retrieving revision 1.5 >diff -u -r1.5 messages.properties >--- src/org/eclipse/jsch/internal/ui/messages.properties 2 Nov 2007 07:15:47 -0000 1.5 >+++ src/org/eclipse/jsch/internal/ui/messages.properties 11 Mar 2008 07:58:32 -0000 >@@ -73,6 +73,8 @@ > CVSSSH2PreferencePage_136=Fingerprint > CVSSSH2PreferencePage_138=&Remove > CVSSSH2PreferencePage_139=Keys of known hosts: >+CVSSSH2PreferencePage_140=&KeepAlive(seconds): >+CVSSSH2PreferencePage_141=invalid value for keep-alive: > UserInfoPrompter_0=SSH2 Message > UserInfoPrompter_1=SSH2 Message > KeyboardInteractiveDialog_0=Keyboard Interactive authentication for {0}: {1} >Index: src/org/eclipse/jsch/internal/ui/Messages.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jsch.ui/src/org/eclipse/jsch/internal/ui/Messages.java,v >retrieving revision 1.4 >diff -u -r1.4 Messages.java >--- src/org/eclipse/jsch/internal/ui/Messages.java 2 Nov 2007 07:15:47 -0000 1.4 >+++ src/org/eclipse/jsch/internal/ui/Messages.java 11 Mar 2008 07:58:32 -0000 >@@ -83,6 +83,8 @@ > public static String CVSSSH2PreferencePage_136; > public static String CVSSSH2PreferencePage_138; > public static String CVSSSH2PreferencePage_139; >+ public static String CVSSSH2PreferencePage_140; >+ public static String CVSSSH2PreferencePage_141; > public static String KeyboardInteractiveDialog_0; > public static String KeyboardInteractiveDialog_1; > public static String KeyboardInteractiveDialog_2; >Index: src/org/eclipse/jsch/internal/ui/preference/PreferencePage.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jsch.ui/src/org/eclipse/jsch/internal/ui/preference/PreferencePage.java,v >retrieving revision 1.6 >diff -u -r1.6 PreferencePage.java >--- src/org/eclipse/jsch/internal/ui/preference/PreferencePage.java 2 Nov 2007 07:15:47 -0000 1.6 >+++ src/org/eclipse/jsch/internal/ui/preference/PreferencePage.java 11 Mar 2008 07:58:32 -0000 >@@ -44,8 +44,10 @@ > > private Label ssh2HomeLabel; > private Label privateKeyLabel; >+ private Label keepAliveLabel; > Text ssh2HomeText; > Text privateKeyText; >+ Text keepAliveText; > private Button privateKeyAdd; > > private Button ssh2HomeBrowse; >@@ -202,6 +204,17 @@ > } > }); > >+ createSpacer(group, 3); >+ >+ keepAliveLabel=new Label(group, SWT.NONE); >+ keepAliveLabel.setText(Messages.CVSSSH2PreferencePage_140); >+ >+ keepAliveText=new Text(group, SWT.SINGLE|SWT.BORDER); >+ keepAliveText.setFont(group.getFont()); >+ gd=new GridData(GridData.FILL_HORIZONTAL); >+ gd.horizontalSpan=1; >+ keepAliveText.setLayoutData(gd); >+ > return group; > } > >@@ -970,6 +983,8 @@ > .getString(org.eclipse.jsch.internal.core.IConstants.KEY_SSH2HOME)); > privateKeyText.setText(preferences > .getString(org.eclipse.jsch.internal.core.IConstants.KEY_PRIVATEKEY)); >+ keepAliveText.setText(preferences >+ .getString(org.eclipse.jsch.internal.core.IConstants.KEY_SERVERALIVEINTERVAL)); > updateControls(); > } > >@@ -989,6 +1004,22 @@ > } > } > } >+ >+ String keepalive=keepAliveText.getText(); >+ int _keepalive=Integer.MAX_VALUE; >+ keepalive=keepalive.trim(); >+ try{ >+ _keepalive=Integer.parseInt(keepalive); >+ if(_keepalive<0) >+ _keepalive=Integer.MAX_VALUE; >+ } >+ catch(NumberFormatException e){ >+ _keepalive=Integer.MAX_VALUE; >+ } >+ if(_keepalive==Integer.MAX_VALUE){ >+ setErrorMessage(Messages.CVSSSH2PreferencePage_141+keepalive); >+ return false; >+ } > > Preferences preferences=JSchCorePlugin.getPlugin().getPluginPreferences(); > preferences.setValue( >@@ -996,6 +1027,9 @@ > preferences.setValue( > org.eclipse.jsch.internal.core.IConstants.KEY_PRIVATEKEY, > privateKeyText.getText()); >+ preferences.setValue( >+ org.eclipse.jsch.internal.core.IConstants.KEY_SERVERALIVEINTERVAL, >+ keepalive); > } > JSchCorePlugin.getPlugin().setNeedToLoadKnownHosts(true); > JSchCorePlugin.getPlugin().setNeedToLoadKeys(true); >@@ -1016,6 +1050,10 @@ > privateKeyText > .setText(preferences > .getDefaultString(org.eclipse.jsch.internal.core.IConstants.KEY_PRIVATEKEY)); >+ keepAliveText >+ .setText(preferences >+ .getDefaultString(org.eclipse.jsch.internal.core.IConstants.KEY_SERVERALIVEINTERVAL)); >+ > updateControls(); > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 222178
: 92133