Added check for removed data page during data ingest, shuts down binary to prevent crash

This commit is contained in:
Thulinma 2020-07-09 23:00:16 +02:00
parent 19a55828a3
commit b4b76850e3

View file

@ -8,6 +8,7 @@
#include <mist/langcodes.h> //LTS
#include <mist/stream.h>
#include <mist/h264.h>
#include <mist/config.h>
namespace Mist{
InOutBase::InOutBase() : M(meta){}
@ -404,6 +405,15 @@ namespace Mist{
return;
}
if (curPage.count(packTrack) && !curPage[packTrack].exists()){
WARN_MSG("Data page was deleted - forcing source shutdown to prevent unstable state");
Util::logExitReason("data page was deleted, forcing shutdown to prevent unstable state");
bufferFinalize(packTrack);
kill(getpid(), SIGINT);
return;
}
if (!curPageNum.count(packTrack) || nextPageNum != curPageNum[packTrack]){
if (curPageNum.count(packTrack)){
// Close the currently opened page when it exists