diff --git a/lib/shared_memory.cpp b/lib/shared_memory.cpp index 0a9eed50..faa2387b 100644 --- a/lib/shared_memory.cpp +++ b/lib/shared_memory.cpp @@ -1105,6 +1105,7 @@ namespace IPC { if (hasCounter) { myPage.mapped[offset] = 1; *((uint32_t *)(myPage.mapped + 1 + offset + len - 4)) = getpid(); + HIGH_MSG("sharedClient received ID %d", offsetOnPage/(payLen+1)); } break; } @@ -1127,8 +1128,6 @@ namespace IPC { ///\brief The deconstructor sharedClient::~sharedClient() { mySemaphore.close(); - - } ///\brief Writes data to the shared data @@ -1151,6 +1150,7 @@ namespace IPC { if (myPage.mapped) { semGuard tmpGuard(&mySemaphore); myPage.mapped[offsetOnPage] = 126; + HIGH_MSG("sharedClient finished ID %d", offsetOnPage/(payLen+1)); } } diff --git a/src/controller/controller_statistics.cpp b/src/controller/controller_statistics.cpp index af9f8fcb..aee7925a 100644 --- a/src/controller/controller_statistics.cpp +++ b/src/controller/controller_statistics.cpp @@ -274,8 +274,12 @@ void Controller::statSession::update(unsigned long index, IPC::statExchange & da } long long currDown = getDown(); long long currUp = getUp(); - servUpBytes += currUp - prevUp; - servDownBytes += currDown - prevDown; + if (currUp - prevUp < 0 || currDown-prevDown < 0){ + ERROR_MSG("Negative data usage! %lldu/%lldd (u%lld->%lld) in %s over %s, #%lu", currUp-prevUp, currDown-prevDown, prevUp, currUp, data.streamName().c_str(), data.connector().c_str(), index); + }else{ + servUpBytes += currUp - prevUp; + servDownBytes += currDown - prevDown; + } if (currDown + currUp > COUNTABLE_BYTES){ std::string streamName = data.streamName(); if (prevUp + prevDown < COUNTABLE_BYTES){ diff --git a/src/output/output.cpp b/src/output/output.cpp index 052e4fb8..55cf3c76 100644 --- a/src/output/output.cpp +++ b/src/output/output.cpp @@ -1300,7 +1300,7 @@ namespace Mist { if (now == lastStats && !force){return;} lastStats = now; - EXTREME_MSG("Writing stats: %s, %s, %lu", getConnectedHost().c_str(), streamName.c_str(), crc & 0xFFFFFFFFu); + HIGH_MSG("Writing stats: %s, %s, %lu, %llu, %llu", getConnectedHost().c_str(), streamName.c_str(), crc & 0xFFFFFFFFu, myConn.dataUp(), myConn.dataDown()); if (statsPage.getData()){ /*LTS-START*/ if (!statsPage.isAlive()){