From 2c8d1479e6cc00ec5437ccc461c15a3a6a7b2e8c Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Fri, 2 Aug 2024 14:43:45 +0200 Subject: [PATCH] BasicRTSPOnlyServer::getInstance(): asserts Replaced conditions with asserts - the exit here is not optimal and it also doesn't say what was the problem. --- src/rtsp/BasicRTSPOnlyServer.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/rtsp/BasicRTSPOnlyServer.cpp b/src/rtsp/BasicRTSPOnlyServer.cpp index 684f78810..bd8698a9f 100644 --- a/src/rtsp/BasicRTSPOnlyServer.cpp +++ b/src/rtsp/BasicRTSPOnlyServer.cpp @@ -43,6 +43,7 @@ */ #include // for "weHaveAnIPv*Address()" +#include #include "rtsp/BasicRTSPOnlyServer.hh" #include "rtsp/BasicRTSPOnlySubsession.hh" @@ -87,10 +88,9 @@ BasicRTSPOnlyServer::getInstance(){ int BasicRTSPOnlyServer::init_server() { - if (env != NULL || rtspServer != NULL || mod == NULL || - avType <= none || avType > rtsp_av_type_last) { - exit(1); - } + assert(env == nullptr && rtspServer == nullptr); + assert(mod != nullptr); + assert(avType > none && avType <= rtsp_av_type_last); //setting livenessTimeoutTask unsigned reclamationTestSeconds = 60;