|
|
|
@ -3617,9 +3617,17 @@ srs_error_t SrsConfig::check_normal_config()
|
|
|
|
|
return srs_error_new(ERROR_SYSTEM_CONFIG_INVALID, "listen requires params");
|
|
|
|
|
}
|
|
|
|
|
for (int i = 0; i < (int)listens.size(); i++) {
|
|
|
|
|
string port = listens[i];
|
|
|
|
|
if (port.empty() || ::atoi(port.c_str()) <= 0) {
|
|
|
|
|
return srs_error_new(ERROR_SYSTEM_CONFIG_INVALID, "listen.port=%s is invalid", port.c_str());
|
|
|
|
|
int port; string ip;
|
|
|
|
|
srs_parse_endpoint(listens[i], ip, port);
|
|
|
|
|
|
|
|
|
|
// check ip
|
|
|
|
|
if (!srs_check_ip_addr_valid(ip)) {
|
|
|
|
|
return srs_error_new(ERROR_SYSTEM_CONFIG_INVALID, "listen.ip=%s is invalid", ip.c_str());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// check port
|
|
|
|
|
if (port <= 0) {
|
|
|
|
|
return srs_error_new(ERROR_SYSTEM_CONFIG_INVALID, "listen.port=%d is invalid", port);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|