BasicRTSPOnlyServer::getInstance(): asserts

Replaced conditions with asserts - the exit here is not optimal and it
also doesn't say what was the problem.
This commit is contained in:
Martin Pulec
2024-08-02 14:43:45 +02:00
parent 263c685069
commit 2c8d1479e6

View File

@@ -43,6 +43,7 @@
*/
#include <GroupsockHelper.hh> // for "weHaveAnIPv*Address()"
#include <cassert>
#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;