Prevent statistics going negative when going through server restarts
This commit is contained in:
parent
776cfe1850
commit
dff150419b
1 changed files with 3 additions and 3 deletions
|
@ -315,13 +315,13 @@ void Controller::statSession::ping(const Controller::sessIndex & index, unsigned
|
|||
if (lastSec < disconnectPoint){
|
||||
switch (sessionType){
|
||||
case SESS_INPUT:
|
||||
streamStats[index.streamName].currIns--;
|
||||
if (streamStats[index.streamName].currIns){streamStats[index.streamName].currIns--;}
|
||||
break;
|
||||
case SESS_OUTPUT:
|
||||
streamStats[index.streamName].currOuts--;
|
||||
if (streamStats[index.streamName].currOuts){streamStats[index.streamName].currOuts--;}
|
||||
break;
|
||||
case SESS_VIEWER:
|
||||
streamStats[index.streamName].currViews--;
|
||||
if (streamStats[index.streamName].currViews){streamStats[index.streamName].currViews--;}
|
||||
break;
|
||||
}
|
||||
uint64_t duration = lastSec - firstSec;
|
||||
|
|
Loading…
Add table
Reference in a new issue