mirror of
https://github.com/kasmtech/KasmVNC.git
synced 2024-11-08 01:04:43 +01:00
Clear disconnected clients from the bottleneck stats api
This commit is contained in:
parent
fae8aa9051
commit
c1ed769780
@ -37,6 +37,7 @@ namespace network {
|
||||
// from main thread
|
||||
void mainUpdateScreen(rfb::PixelBuffer *pb);
|
||||
void mainUpdateBottleneckStats(const char userid[], const char stats[]);
|
||||
void mainClearBottleneckStats(const char userid[]);
|
||||
void mainUpdateServerFrameStats(uint8_t changedPerc, uint32_t all,
|
||||
uint32_t jpeg, uint32_t webp, uint32_t analysis,
|
||||
uint32_t jpegarea, uint32_t webparea,
|
||||
|
@ -110,6 +110,15 @@ void GetAPIMessager::mainUpdateBottleneckStats(const char userid[], const char s
|
||||
pthread_mutex_unlock(&statMutex);
|
||||
}
|
||||
|
||||
void GetAPIMessager::mainClearBottleneckStats(const char userid[]) {
|
||||
if (pthread_mutex_trylock(&statMutex))
|
||||
return;
|
||||
|
||||
bottleneckStats.erase(userid);
|
||||
|
||||
pthread_mutex_unlock(&statMutex);
|
||||
}
|
||||
|
||||
void GetAPIMessager::mainUpdateServerFrameStats(uint8_t changedPerc,
|
||||
uint32_t all, uint32_t jpeg, uint32_t webp, uint32_t analysis,
|
||||
uint32_t jpegarea, uint32_t webparea,
|
||||
|
@ -133,8 +133,10 @@ VNCSConnectionST::~VNCSConnectionST()
|
||||
|
||||
delete [] fenceData;
|
||||
|
||||
if (server->apimessager)
|
||||
if (server->apimessager) {
|
||||
server->apimessager->mainUpdateUserInfo(checkOwnerConn(), server->clients.size());
|
||||
server->apimessager->mainClearBottleneckStats(peerEndpoint.buf);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user