Skip to content

Commit

Permalink
MyFrameMain: don't show empty host,port on reverse conn disconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
bk138 committed Nov 3, 2023
1 parent a2a4965 commit 7d1c3df
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/gui/MyFrameMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -411,15 +411,22 @@ void MyFrameMain::onVNCConnDisconnectNotify(wxCommandEvent& event)
// get sender
VNCConn* c = static_cast<VNCConn*>(event.GetEventObject());

wxLogStatus( _("Connection to %s:%s terminated."), c->getServerHost().c_str(), c->getServerPort().c_str());

if (!c->getServerHost().IsEmpty()) {
wxLogStatus(_("Connection to %s:%s terminated."), c->getServerHost().c_str(), c->getServerPort().c_str());
} else {
wxLogStatus(_("Reverse connection terminated."));
}

wxArrayString log = VNCConn::getLog();
// show last 3 log strings
for(size_t i = log.GetCount() >= 3 ? log.GetCount()-3 : 0; i < log.GetCount(); ++i)
wxLogMessage(log[i]);
wxLogMessage( _("Connection to %s:%s terminated."), c->getServerHost().c_str(), c->getServerPort().c_str() );


if (!c->getServerHost().IsEmpty()) {
wxLogMessage(_("Connection to %s:%s terminated."), c->getServerHost().c_str(), c->getServerPort().c_str());
} else {
wxLogMessage(_("Reverse connection terminated."));
}

// find index of this connection
vector<ConnBlob>::iterator it = connections.begin();
size_t index = 0;
Expand Down

0 comments on commit 7d1c3df

Please sign in to comment.