]> source.dussan.org Git - tigervnc.git/commitdiff
Fix connection close log
authorPierre Ossman <ossman@cendio.se>
Fri, 23 Nov 2018 17:03:31 +0000 (18:03 +0100)
committerPierre Ossman <ossman@cendio.se>
Tue, 19 May 2020 18:05:32 +0000 (20:05 +0200)
The socket is closed at this point so we have to rely on a cached
value for the logging.

common/rfb/VNCSConnectionST.h
common/rfb/VNCServerST.cxx

index 7ec2d40b4157a37e0cdfb93a3b30181687442396..46a2b28b12209d4ee94ddbf1bf000dbe2f87f443 100644 (file)
@@ -105,6 +105,8 @@ namespace rfb {
       updates.add_copied(dest, delta);
     }
 
+    const char* getPeerEndpoint() const {return peerEndpoint.buf;}
+
   private:
     // SConnection callbacks
 
index b3cc7a1f91b35aeed34de295279fa4c5b286eaaf..8a005334521816a674c2b74969931710d3c1f8e8 100644 (file)
@@ -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