1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-09 10:46:02 +02:00

Merge branch 'R2_0_maintenance'

This commit is contained in:
Greg Watson 2015-06-26 11:54:59 -04:00
commit cea4bd4eb3
2 changed files with 28 additions and 11 deletions

View file

@ -46,9 +46,12 @@ public class TerminalConsoleConnector {
public OutThread() { public OutThread() {
super("Terminal Output"); //$NON-NLS-1$ super("Terminal Output"); //$NON-NLS-1$
} }
@Override
public void run() { public void run() {
try { try {
byte[] buff = new byte[1024]; byte[] buff = new byte[1024];
if (remoteProcess != null) {
InputStream in = remoteProcess.getInputStream(); InputStream in = remoteProcess.getInputStream();
for (int n = in.read(buff); n >= 0; n = in.read(buff)) { for (int n = in.read(buff); n >= 0; n = in.read(buff)) {
for (PageConnector connector : pageConnectors) { for (PageConnector connector : pageConnectors) {
@ -58,6 +61,7 @@ public class TerminalConsoleConnector {
} }
} }
} }
}
setState(TerminalState.CLOSED); setState(TerminalState.CLOSED);
synchronized (TerminalConsoleConnector.this) { synchronized (TerminalConsoleConnector.this) {
outThread = null; outThread = null;
@ -67,6 +71,7 @@ public class TerminalConsoleConnector {
} }
} }
} }
private OutThread outThread; private OutThread outThread;
public TerminalConsoleConnector(IRemoteConnection connection) { public TerminalConsoleConnector(IRemoteConnection connection) {
@ -153,7 +158,7 @@ public class TerminalConsoleConnector {
} }
public void disconnect() { public void disconnect() {
if (!remoteProcess.isCompleted()) { if (remoteProcess != null && !remoteProcess.isCompleted()) {
new Job(ConsoleMessages.DISCONNECTING) { new Job(ConsoleMessages.DISCONNECTING) {
@Override @Override
protected IStatus run(IProgressMonitor monitor) { protected IStatus run(IProgressMonitor monitor) {
@ -200,7 +205,7 @@ public class TerminalConsoleConnector {
@Override @Override
public OutputStream getTerminalToRemoteStream() { public OutputStream getTerminalToRemoteStream() {
return remoteProcess.getOutputStream(); return remoteProcess != null ? remoteProcess.getOutputStream() : null;
} }
@Override @Override

View file

@ -10,6 +10,8 @@
*******************************************************************************/ *******************************************************************************/
package org.eclipse.remote.internal.core; package org.eclipse.remote.internal.core;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
@ -127,11 +129,21 @@ public class RemoteConnection implements IRemoteConnection {
} }
Preferences getPreferences() { Preferences getPreferences() {
return connectionType.getPreferenceNode().node(name); try {
return connectionType.getPreferenceNode().node(URLEncoder.encode(name, "UTF-8")); //$NON-NLS-1$
} catch (UnsupportedEncodingException e) {
// Should not happen!
throw new RuntimeException(e);
}
} }
ISecurePreferences getSecurePreferences() { ISecurePreferences getSecurePreferences() {
return connectionType.getSecurePreferencesNode().node(name); try {
return connectionType.getSecurePreferencesNode().node(URLEncoder.encode(name, "UTF-8")); //$NON-NLS-1$
} catch (UnsupportedEncodingException e) {
// Should not happen!
throw new RuntimeException(e);
}
} }
/* /*