Skip to content

Commit

Permalink
Use displayId in SSH connections.
Browse files Browse the repository at this point in the history
  • Loading branch information
jksiezni committed Jun 19, 2015
1 parent 1d174aa commit c12833e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
1 change: 0 additions & 1 deletion xpra-client-android/res/xml/connection_preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,4 @@
android:title="SSH Private key" />
</PreferenceCategory>


</PreferenceScreen>
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,9 @@ private void setupSSHConnector(SshXpraConnector connector, Connection c) {
if(c.sshPrivateKeyFile != null) {
connector.getJsch().addIdentity(c.sshPrivateKeyFile);
}
if(c.displayId >= 0) {
connector.setDisplay(c.displayId);
}
} catch (JSchException | IOException e) {
// TODO implement some fix if necessary
e.printStackTrace();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class Connection {
public int port;

@DatabaseField(columnName="display_id")
public int displayId;
public int displayId = -1;

@DatabaseField
public String username;
Expand Down
8 changes: 7 additions & 1 deletion xpra-common/src/main/java/xpra/network/SshXpraConnector.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ public class SshXpraConnector extends XpraConnector implements Runnable {
private final String username;
private final String host;
private final int port;

private int display = 100;

private Thread thread;
private Session session;
Expand Down Expand Up @@ -111,7 +113,7 @@ public void run() {
try {
session.connect();
final Channel channel = session.openChannel("exec");
((ChannelExec) channel).setCommand("~/.xpra/run-xpra _proxy :100");
((ChannelExec) channel).setCommand("~/.xpra/run-xpra _proxy :" + display);
channel.connect();

final InputStream in = channel.getInputStream();
Expand Down Expand Up @@ -144,5 +146,9 @@ public void run() {
public JSch getJsch() {
return jsch;
}

public void setDisplay(int displayId) {
this.display = displayId;
}

}

0 comments on commit c12833e

Please sign in to comment.