1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-02-15 04:42:04 +00:00

refine config, check the value of http api/stream.

This commit is contained in:
winlin 2014-07-25 10:54:36 +08:00
parent 7207c2f435
commit 630bdf0c80

View file

@ -1405,6 +1405,42 @@ int SrsConfig::check_config()
return ret;
}
////////////////////////////////////////////////////////////////////////
// check heartbeat
////////////////////////////////////////////////////////////////////////
if (get_heartbeat_interval() <= 0) {
ret = ERROR_SYSTEM_CONFIG_INVALID;
srs_error("directive heartbeat interval invalid, interval=%"PRId64", ret=%d",
get_heartbeat_interval(), ret);
return ret;
}
if (get_heartbeat_device_index() < 0) {
ret = ERROR_SYSTEM_CONFIG_INVALID;
srs_error("directive heartbeat device_index invalid, device_index=%d, ret=%d",
get_heartbeat_device_index(), ret);
return ret;
}
////////////////////////////////////////////////////////////////////////
// check http api
////////////////////////////////////////////////////////////////////////
if (get_http_api_listen() <= 0) {
ret = ERROR_SYSTEM_CONFIG_INVALID;
srs_error("directive http_api listen invalid, listen=%d, ret=%d",
get_http_api_listen(), ret);
return ret;
}
////////////////////////////////////////////////////////////////////////
// check http stream
////////////////////////////////////////////////////////////////////////
if (get_http_stream_listen() <= 0) {
ret = ERROR_SYSTEM_CONFIG_INVALID;
srs_error("directive http_stream listen invalid, listen=%d, ret=%d",
get_http_stream_listen(), ret);
return ret;
}
// TODO: FIXME: check others.
////////////////////////////////////////////////////////////////////////