Skip to content

Commit d019475

Browse files
committed
VNCConn: fix getServer[Host|Port]() for SSH tunneling case
re #200
1 parent a65cb3d commit d019475

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/VNCConn.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1206,6 +1206,9 @@ bool VNCConn::Init(const wxString& host,
12061206
// Support short-form (:0, :1)
12071207
if(cl->serverPort < 100)
12081208
cl->serverPort += 5900;
1209+
// these might later get changed by the SSH tunneling setup so save them here
1210+
this->serverHost = wxString(cl->serverHost, wxConvUTF8);
1211+
this->serverPort = wxString() << cl->serverPort;
12091212

12101213
if(repeaterId >= 0) {
12111214
cl->destHost = strdup("ID");
@@ -1822,7 +1825,7 @@ wxString VNCConn::getServerHost() const
18221825
if(cl->listenSpecified)
18231826
return wxEmptyString;
18241827
else
1825-
return wxString(cl->serverHost, wxConvUTF8);
1828+
return serverHost;
18261829
}
18271830
else
18281831
return wxEmptyString;
@@ -1833,7 +1836,7 @@ wxString VNCConn::getServerHost() const
18331836
wxString VNCConn::getServerPort() const
18341837
{
18351838
if(cl)
1836-
return wxString() << cl->serverPort;
1839+
return serverPort;
18371840
else
18381841
return wxEmptyString;
18391842
}

src/VNCConn.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,9 @@ class VNCConn: public wxEvtHandler, public wxThreadHelper
217217
rfbClient* cl;
218218
bool setupClient();
219219

220+
wxString serverHost;
221+
wxString serverPort;
222+
220223
wxRect updated_rect;
221224

222225
wxCriticalSection mutex_framebuffer;

0 commit comments

Comments
 (0)