From d9ea25b44154b603f02b02ed3dace11185889929 Mon Sep 17 00:00:00 2001 From: OSSRS-AI Date: Fri, 24 Oct 2025 22:21:34 -0400 Subject: [PATCH] AI: Update conf description for multiple ep for callback. #4421 --- trunk/conf/full.conf | 4 ++++ trunk/conf/http.hooks.callback.conf | 4 ++++ trunk/src/utest/srs_utest_manual_st.cpp | 12 ++++++------ 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/trunk/conf/full.conf b/trunk/conf/full.conf index dd0900188..1b7595730 100644 --- a/trunk/conf/full.conf +++ b/trunk/conf/full.conf @@ -1123,6 +1123,8 @@ vhost hooks.callback.srs.com { # @remark For SRS4, the HTTPS url is supported, for example: # on_publish https://xxx/api0 https://xxx/api1 https://xxx/apiN # Overwrite by env SRS_VHOST_HTTP_HOOKS_ON_PUBLISH for all vhosts. + # @remark When using environment variables, use space-separated URLs with proper quoting: + # SRS_VHOST_HTTP_HOOKS_ON_PUBLISH="https://xxx/api0 https://xxx/api1" on_publish http://127.0.0.1:8085/api/v1/streams http://localhost:8085/api/v1/streams; # when client(encoder) stop publish to vhost/app/stream, call the hook, # the request in the POST data string is a object encode by json: @@ -1160,6 +1162,8 @@ vhost hooks.callback.srs.com { # @remark For SRS4, the HTTPS url is supported, for example: # on_play https://xxx/api0 https://xxx/api1 https://xxx/apiN # Overwrite by env SRS_VHOST_HTTP_HOOKS_ON_PLAY for all vhosts. + # @remark When using environment variables, use space-separated URLs with proper quoting: + # SRS_VHOST_HTTP_HOOKS_ON_PLAY="https://xxx/api0 https://xxx/api1" on_play http://127.0.0.1:8085/api/v1/sessions http://localhost:8085/api/v1/sessions; # when client stop to play vhost/app/stream, call the hook, # the request in the POST data string is a object encode by json: diff --git a/trunk/conf/http.hooks.callback.conf b/trunk/conf/http.hooks.callback.conf index 91fdba401..94b65b642 100644 --- a/trunk/conf/http.hooks.callback.conf +++ b/trunk/conf/http.hooks.callback.conf @@ -1,5 +1,9 @@ # http-hooks or http-callbacks config for srs. # @see full.conf for detail config. +# +# Multiple URLs can be specified for each hook (space-separated). +# When using environment variables, use space-separated URLs with proper quoting: +# SRS_VHOST_HTTP_HOOKS_ON_PLAY="http://url1 http://url2" max_connections 1000; daemon off; diff --git a/trunk/src/utest/srs_utest_manual_st.cpp b/trunk/src/utest/srs_utest_manual_st.cpp index 833218277..ddd19c26b 100644 --- a/trunk/src/utest/srs_utest_manual_st.cpp +++ b/trunk/src/utest/srs_utest_manual_st.cpp @@ -85,8 +85,8 @@ VOID TEST(StTest, StUtimePerformance) // Calculate absolute difference between the two elapsed times int time_diff = gettimeofday_elapsed_time > st_utime_elapsed_time - ? gettimeofday_elapsed_time - st_utime_elapsed_time - : st_utime_elapsed_time - gettimeofday_elapsed_time; + ? gettimeofday_elapsed_time - st_utime_elapsed_time + : st_utime_elapsed_time - gettimeofday_elapsed_time; // The difference should be less than N clock ticks (microseconds) EXPECT_LT(time_diff, 100); @@ -111,8 +111,8 @@ VOID TEST(StTest, StUtimePerformance) // Calculate absolute difference between the two elapsed times int time_diff = gettimeofday_elapsed_time > st_utime_elapsed_time - ? gettimeofday_elapsed_time - st_utime_elapsed_time - : st_utime_elapsed_time - gettimeofday_elapsed_time; + ? gettimeofday_elapsed_time - st_utime_elapsed_time + : st_utime_elapsed_time - gettimeofday_elapsed_time; // The difference should be less than N clock ticks (microseconds) EXPECT_LT(time_diff, 100); @@ -139,8 +139,8 @@ VOID TEST(StTest, StUtimePerformance) // Calculate absolute difference between the two elapsed times int time_diff = gettimeofday_elapsed_time > st_utime_elapsed_time - ? gettimeofday_elapsed_time - st_utime_elapsed_time - : st_utime_elapsed_time - gettimeofday_elapsed_time; + ? gettimeofday_elapsed_time - st_utime_elapsed_time + : st_utime_elapsed_time - gettimeofday_elapsed_time; // The difference should be less than N clock ticks (microseconds) EXPECT_LT(time_diff, 100);