Lines 120-125
Link Here
|
120 |
while (firstTime || tryAgain) { |
120 |
while (firstTime || tryAgain) { |
121 |
tryAgain = false; // reset the try again flag |
121 |
tryAgain = false; // reset the try again flag |
122 |
session = JSchSession.getSession(location, location.getUsername(), password, location.getHost(), location.getPort(), monitor); |
122 |
session = JSchSession.getSession(location, location.getUsername(), password, location.getHost(), location.getPort(), monitor); |
|
|
123 |
if(session.getSession().getTimeout()!=location.getTimeout()*1000) |
124 |
session.getSession().setTimeout(location.getTimeout()*1000); |
123 |
channel = session.getSession().openChannel("exec"); //$NON-NLS-1$ |
125 |
channel = session.getSession().openChannel("exec"); //$NON-NLS-1$ |
124 |
((ChannelExec) channel).setCommand(COMMAND); |
126 |
((ChannelExec) channel).setCommand(COMMAND); |
125 |
channel_out = channel.getOutputStream(); |
127 |
channel_out = channel.getOutputStream(); |
Lines 152-164
Link Here
|
152 |
// Don't close the underlying stream as it belongs to the session |
154 |
// Don't close the underlying stream as it belongs to the session |
153 |
} |
155 |
} |
154 |
}, |
156 |
}, |
155 |
8192 /*bufferSize*/, 1000 /*readTimeout*/, -1 /*closeTimeout*/, true /* growWhenFull */), timeout > 0 ? timeout : 1, monitor); |
157 |
8192 /*bufferSize*/, timeout*1000 /*readTimeout*/, -1 /*closeTimeout*/, true /* growWhenFull */), timeout > 0 ? timeout : 1, monitor); |
156 |
outputStream = new PollingOutputStream(new TimeoutOutputStream(new FilterOutputStream(channel_out) { |
158 |
outputStream = new PollingOutputStream(new TimeoutOutputStream(new FilterOutputStream(channel_out) { |
157 |
public void close() { |
159 |
public void close() { |
158 |
// Don't close the underlying stream as it belongs to the session |
160 |
// Don't close the underlying stream as it belongs to the session |
159 |
} |
161 |
} |
160 |
}, |
162 |
}, |
161 |
8192 /*buffersize*/, 1000 /*writeTimeout*/, 1000 /*closeTimeout*/), timeout > 0 ? timeout : 1, monitor); |
163 |
8192 /*buffersize*/, timeout*1000 /*writeTimeout*/, -1 /*closeTimeout*/), timeout > 0 ? timeout : 1, monitor); |
162 |
} catch (final JSchException e) { |
164 |
} catch (final JSchException e) { |
163 |
if (isSSH2Unsupported(e)) { |
165 |
if (isSSH2Unsupported(e)) { |
164 |
ssh1 = new SSHServerConnection(location, password); |
166 |
ssh1 = new SSHServerConnection(location, password); |