Skip to content

Commit a17b950

Browse files
authored
Install http api and hook before starting the service listener (ZLMediaKit#3149)
We have found that sometimes, when starting zlmediakit, stream push requests may be received before the hook is ready.
1 parent c7f2f9e commit a17b950

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

server/main.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,11 @@ int start_main(int argc,char *argv[]) {
346346
uint16_t srtPort = mINI::Instance()[SRT::kPort];
347347
#endif //defined(ENABLE_SRT)
348348

349+
installWebApi();
350+
InfoL << "已启动http api 接口";
351+
installWebHook();
352+
InfoL << "已启动http hook 接口";
353+
349354
try {
350355
auto &secret = mINI::Instance()[API::kSecret];
351356
if (secret == "035c73f7-bb6b-4889-a715-d9eb2d1925cc" || secret.empty()) {
@@ -403,11 +408,6 @@ int start_main(int argc,char *argv[]) {
403408
return -1;
404409
}
405410

406-
installWebApi();
407-
InfoL << "已启动http api 接口";
408-
installWebHook();
409-
InfoL << "已启动http hook 接口";
410-
411411
//设置退出信号处理函数
412412
static semaphore sem;
413413
signal(SIGINT, [](int) {

0 commit comments

Comments
 (0)