From: Pierre Ossman Date: Fri, 23 Nov 2018 17:03:31 +0000 (+0100) Subject: Fix connection close log X-Git-Tag: v1.11.90~74^2~24 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=585089797f7f79a5f521b54e659d1781246e40c1;p=tigervnc.git Fix connection close log The socket is closed at this point so we have to rely on a cached value for the logging. --- 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