Skip to content

Commit

Permalink
Android: native: rename SSH tunnel var
Browse files Browse the repository at this point in the history
  • Loading branch information
bk138 committed Nov 24, 2023
1 parent 64618d2 commit 7da078d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions android/app/src/main/cpp/vncconn.c
Original file line number Diff line number Diff line change
Expand Up @@ -483,19 +483,19 @@ JNIEXPORT jboolean JNICALL Java_com_coboltforge_dontmind_multivnc_VNCConn_rfbIni
if(is_ssh_connection) {
log_obj_tostring(env, obj, ANDROID_LOG_INFO, "rfbInit() setting up SSH-tunneled connection");
// ssh-tunneling, check whether it's password- or key-based
ssh_tunnel_t *data;
ssh_tunnel_t *tunnel;
if(cSshPassword) {
// password-based
data = ssh_tunnel_open_with_password(cSshHost, cSshUser, cSshPassword, cHost, port, cl, onSshFingerprintCheck, onSshError);
tunnel = ssh_tunnel_open_with_password(cSshHost, cSshUser, cSshPassword, cHost, port, cl, onSshFingerprintCheck, onSshError);
} else {
// key-based
data = ssh_tunnel_open_with_privkey(cSshHost, cSshUser, (char*)cSshPrivKey, cSshPrivKeyLen, cSshPrivKeyPassword, cHost, port, cl, onSshFingerprintCheck, onSshError);
tunnel = ssh_tunnel_open_with_privkey(cSshHost, cSshUser, (char*)cSshPrivKey, cSshPrivKeyLen, cSshPrivKeyPassword, cHost, port, cl, onSshFingerprintCheck, onSshError);
}

cl->serverHost = strdup("127.0.0.1");
if(data) // might be NULL if ssh setup failed
cl->serverPort = ssh_tunnel_get_port(data);
rfbClientSetClientData(cl, VNCCONN_SSH_ID, data);
if(tunnel) // might be NULL if ssh setup failed
cl->serverPort = ssh_tunnel_get_port(tunnel);
rfbClientSetClientData(cl, VNCCONN_SSH_ID, tunnel);
} else {
log_obj_tostring(env, obj, ANDROID_LOG_INFO, "rfbInit() setting up direct connection");
// direct connection
Expand Down

0 comments on commit 7da078d

Please sign in to comment.