Fixes timeout on slow loading VOD input

This commit is contained in:
Marco van Dijk 2022-11-30 16:56:04 +01:00 committed by Thulinma
parent ae9aadc0b1
commit 393fa9e403
2 changed files with 3 additions and 2 deletions

View file

@ -1482,6 +1482,7 @@ namespace Mist{
for (size_t i = 0; i < keyNum; ++i){partNo += keys.getParts(i);} for (size_t i = 0; i < keyNum; ++i){partNo += keys.getParts(i);}
DTSC::Parts parts(M.parts(idx)); DTSC::Parts parts(M.parts(idx));
while (thisPacket && thisTime < stopTime){ while (thisPacket && thisTime < stopTime){
if (connectedUsers){activityCounter = Util::bootSecs();}
if (thisTime >= lastBuffered){ if (thisTime >= lastBuffered){
if (sourceIdx != idx){ if (sourceIdx != idx){
if (encryption.find(":") != std::string::npos || M.getEncryption(idx).find(":") != std::string::npos){ if (encryption.find(":") != std::string::npos || M.getEncryption(idx).find(":") != std::string::npos){

View file

@ -9,6 +9,7 @@
#include <stdio.h> #include <stdio.h>
// Global counters // Global counters
uint64_t thisType = 0;
uint64_t now = Util::bootSecs(); uint64_t now = Util::bootSecs();
uint64_t currentConnections = 0; uint64_t currentConnections = 0;
uint64_t lastSecond = 0; uint64_t lastSecond = 0;
@ -44,7 +45,7 @@ const char nullAddress[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
void userOnActive(Comms::Connections &connections, size_t idx){ void userOnActive(Comms::Connections &connections, size_t idx){
uint64_t lastUpdate = connections.getNow(idx); uint64_t lastUpdate = connections.getNow(idx);
if (lastUpdate < now - 10){return;} if (lastUpdate < now - 10 && thisType != 1){return;}
++currentConnections; ++currentConnections;
std::string thisConnector = connections.getConnector(idx); std::string thisConnector = connections.getConnector(idx);
std::string thisStreamName = connections.getStream(idx); std::string thisStreamName = connections.getStream(idx);
@ -235,7 +236,6 @@ int main(int argc, char **argv){
if (memcmp(thisHost.data(), nullAddress, 16)){hostLastActive[thisHost] = now;} if (memcmp(thisHost.data(), nullAddress, 16)){hostLastActive[thisHost] = now;}
// Determine session type, since triggers only get run for viewer type sessions // Determine session type, since triggers only get run for viewer type sessions
uint64_t thisType = 0;
if (thisSessionId[0] == 'I'){ if (thisSessionId[0] == 'I'){
thisType = 1; thisType = 1;
} else if (thisSessionId[0] == 'O'){ } else if (thisSessionId[0] == 'O'){