From 80513c86160c6f6d4c2d1e6a1987e3ccea144ee8 Mon Sep 17 00:00:00 2001 From: Lauri Kasanen Date: Fri, 2 Oct 2020 14:44:33 +0300 Subject: [PATCH] Change "recent" to be 10s from 60s, and in its own variable --- common/rfb/VNCSConnectionST.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common/rfb/VNCSConnectionST.cxx b/common/rfb/VNCSConnectionST.cxx index 6391d9e..18779a5 100644 --- a/common/rfb/VNCSConnectionST.cxx +++ b/common/rfb/VNCSConnectionST.cxx @@ -1303,10 +1303,12 @@ void VNCSConnectionST::screenLayoutChange(rdr::U16 reason) cp.screenLayout); } +static const unsigned recentSecs = 10; + static void pruneStatList(std::list &list, const struct timeval &now) { std::list::iterator it; for (it = list.begin(); it != list.end(); ) { - if ((*it).tv_sec + 60 < now.tv_sec) + if ((*it).tv_sec + recentSecs < now.tv_sec) it = list.erase(it); else it++;