diff options
author | Pierre Ossman <ossman@cendio.se> | 2018-11-23 18:03:31 +0100 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2020-05-19 20:05:32 +0200 |
commit | 585089797f7f79a5f521b54e659d1781246e40c1 (patch) | |
tree | ef417b4b06905ef4e19c6e4818557a9d59a5576a | |
parent | 4f104264e2ddafe7d767491a2fb453074eb9beaf (diff) | |
download | tigervnc-585089797f7f79a5f521b54e659d1781246e40c1.tar.gz tigervnc-585089797f7f79a5f521b54e659d1781246e40c1.zip |
Fix connection close log
The socket is closed at this point so we have to rely on a cached
value for the logging.
-rw-r--r-- | common/rfb/VNCSConnectionST.h | 2 | ||||
-rw-r--r-- | common/rfb/VNCServerST.cxx | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/common/rfb/VNCSConnectionST.h b/common/rfb/VNCSConnectionST.h index 7ec2d40b..46a2b28b 100644 --- a/common/rfb/VNCSConnectionST.h +++ b/common/rfb/VNCSConnectionST.h @@ -105,6 +105,8 @@ namespace rfb { updates.add_copied(dest, delta); } + const char* getPeerEndpoint() const {return peerEndpoint.buf;} + private: // SConnection callbacks diff --git a/common/rfb/VNCServerST.cxx b/common/rfb/VNCServerST.cxx index b3cc7a1f..8a005334 100644 --- a/common/rfb/VNCServerST.cxx +++ b/common/rfb/VNCServerST.cxx @@ -177,13 +177,13 @@ void VNCServerST::removeSocket(network::Socket* sock) { if (rfb::Server::maxDisconnectionTime && clients.empty()) disconnectTimer.start(secsToMillis(rfb::Server::maxDisconnectionTime)); + CharArray name(strDup((*ci)->getPeerEndpoint())); + // - Delete the per-Socket resources delete *ci; clients.remove(*ci); - CharArray name; - name.buf = sock->getPeerEndpoint(); connectionsLog.status("closed: %s", name.buf); // - Check that the desktop object is still required |