diff --git a/src/http/eventdispatcher.cpp b/src/http/eventdispatcher.cpp index 0f64f209..d44b6259 100644 --- a/src/http/eventdispatcher.cpp +++ b/src/http/eventdispatcher.cpp @@ -118,12 +118,15 @@ static void processTimer() DateTime::s_curTimeUs = tv.tv_usec; NtwkIOLink::setPrevToken(NtwkIOLink::getToken()); NtwkIOLink::setToken(tv.tv_usec / (1000000 / TIMER_PRECISION)); - QuicEngine *pQuicEngine = HttpServer::getInstance().getQuicEngine(); - if (pQuicEngine) - pQuicEngine->onTimer(); - if (NtwkIOLink::getToken() < NtwkIOLink::getPrevToken()) - HttpServer::getInstance().onTimer(); - MultiplexerFactory::getMultiplexer()->timerExecute(); + if (NtwkIOLink::getToken() != NtwkIOLink::getPrevToken()) + { + QuicEngine *pQuicEngine = HttpServer::getInstance().getQuicEngine(); + if (pQuicEngine) + pQuicEngine->onTimer(); + if (NtwkIOLink::getToken() < NtwkIOLink::getPrevToken()) + HttpServer::getInstance().onTimer(); + MultiplexerFactory::getMultiplexer()->timerExecute(); + } } @@ -376,6 +379,7 @@ int EventDispatcher::linger(int listenerStopped, int timeout) #ifdef LS_HAS_RTSIG SigEventDispatcher::getInstance().processSigEvent(); #endif + processTimer(); if (pQuicEngine) pQuicEngine->processEvents(); @@ -396,7 +400,6 @@ int EventDispatcher::linger(int listenerStopped, int timeout) if (HttpSignals::gotSigAlarm()) { HttpSignals::resetEvents(); - processTimer(); } if (HttpSignals::gotSigChild()) HttpServer::cleanPid(); diff --git a/src/main/httpserver.cpp b/src/main/httpserver.cpp index c5398329..57653c04 100644 --- a/src/main/httpserver.cpp +++ b/src/main/httpserver.cpp @@ -926,12 +926,10 @@ void HttpServerImpl::onTimerSecond() { HttpRespHeaders::updateDateHeader(); HttpLog::onTimer(); + ClientCache::getClientCache()->onTimer(); m_vhosts.onTimer(); if (m_lStartTime > 0) - { - ClientCache::getClientCache()->onTimer(); generateRTReport(); - } ServerInfo::getServerInfo()->setAdnsOp(1); Adns::getInstance().trimCache(); diff --git a/src/main/lshttpdmain.cpp b/src/main/lshttpdmain.cpp index 3ecffa71..aca3eabb 100644 --- a/src/main/lshttpdmain.cpp +++ b/src/main/lshttpdmain.cpp @@ -81,7 +81,7 @@ /*** * Do not change the below format, it will be set correctly while packing the code */ -#define BUILDTIME " (built: Thu Apr 1 02:33:32 UTC 2021)" +#define BUILDTIME " (built: Tue Apr 6 13:20:57 UTC 2021)" #define GlobalServerSessionHooks (LsiApiHooks::getServerSessionHooks())