Skip to content

Commit

Permalink
handle exception for listen parameter doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
sangbumlikeagod committed Dec 29, 2024
1 parent 1e848d9 commit 220f743
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions trunk/src/app/srs_app_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7741,6 +7741,10 @@ std::vector<std::string> SrsConfig::get_http_apis_listens()
return ports;
}
conf = conf->get("listen");
if (!conf) {
ports.push_back(DEFAULT);
return ports;
}
for (int i = 0; i < (int)conf->args.size(); i++) {
ports.push_back(conf->args.at(i));
}
Expand Down Expand Up @@ -7969,6 +7973,10 @@ std::vector<std::string> SrsConfig::get_https_apis_listens()
return ports;
}
conf = conf->get("listen");
if (!conf) {
ports.push_back(DEFAULT);
return ports;
}
for (int i = 0; i < (int)conf->args.size(); i++) {
ports.push_back(conf->args.at(i));
}
Expand Down Expand Up @@ -8405,6 +8413,10 @@ std::vector<std::string> SrsConfig::get_http_streams_listens()
return ports;
}
conf = conf->get("listen");
if (!conf) {
ports.push_back(DEFAULT);
return ports;
}
for (int i = 0; i < (int)conf->args.size(); i++) {
ports.push_back(conf->args.at(i));
}
Expand Down Expand Up @@ -8530,6 +8542,10 @@ std::vector<std::string> SrsConfig::get_https_streams_listens()
return ports;
}
conf = conf->get("listen");
if (!conf) {
ports.push_back(DEFAULT);
return ports;
}
for (int i = 0; i < (int)conf->args.size(); i++) {
ports.push_back(conf->args.at(i));
}
Expand Down

0 comments on commit 220f743

Please sign in to comment.