Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Network
KRDC
Commits
8111867c
Commit
8111867c
authored
Sep 13, 2021
by
Luke Dashjr
Browse files
VncView: Use an ephemeral port for SSH forwarding
BUG: 442348
parent
22861e22
Changes
1
Hide whitespace changes
Inline
Side-by-side
vnc/vncview.cpp
View file @
8111867c
...
...
@@ -212,16 +212,13 @@ bool VncView::start()
m_quitFlag
=
false
;
QString
vncHost
=
m_host
;
int
vncPort
=
m_port
;
#ifdef LIBSSH_FOUND
if
(
m_hostPreferences
->
useSshTunnel
())
{
Q_ASSERT
(
!
m_sshTunnelThread
);
const
int
tunnelPort
=
58219
;
// Just a random port
m_sshTunnelThread
=
new
VncSshTunnelThread
(
m_host
.
toUtf8
(),
m_port
,
tunnelPort
,
/*
tunnelPort
*/
0
,
m_hostPreferences
->
sshTunnelPort
(),
m_hostPreferences
->
sshTunnelUserName
().
toUtf8
(),
m_hostPreferences
->
useSshTunnelLoopback
());
...
...
@@ -232,12 +229,10 @@ bool VncView::start()
if
(
m_hostPreferences
->
useSshTunnelLoopback
())
{
vncHost
=
QStringLiteral
(
"127.0.0.1"
);
}
vncPort
=
tunnelPort
;
}
#endif
vncThread
.
setHost
(
vncHost
);
vncThread
.
setPort
(
vncPort
);
RemoteView
::
Quality
quality
;
#ifdef QTONLY
quality
=
(
RemoteView
::
Quality
)((
QCoreApplication
::
arguments
().
count
()
>
2
)
?
...
...
@@ -264,11 +259,15 @@ bool VncView::start()
#ifdef LIBSSH_FOUND
if
(
m_hostPreferences
->
useSshTunnel
())
{
connect
(
m_sshTunnelThread
,
&
VncSshTunnelThread
::
listenReady
,
this
,
[
this
]
{
vncThread
.
start
();
});
connect
(
m_sshTunnelThread
,
&
VncSshTunnelThread
::
listenReady
,
this
,
[
this
]
{
vncThread
.
setPort
(
m_sshTunnelThread
->
tunnelPort
());
vncThread
.
start
();
});
}
else
#endif
{
vncThread
.
setPort
(
m_port
);
vncThread
.
start
();
}
return
true
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment