From f69204b3218eef14f5a8546de86709367ea173e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=8F=E6=A5=9A?= <771730766@qq.com> Date: Sun, 13 Aug 2023 20:46:08 +0800 Subject: [PATCH] =?UTF-8?q?hook=E8=AF=B7=E6=B1=82=E6=B7=BB=E5=8A=A0hook=5F?= =?UTF-8?q?index,=20=E9=98=B2=E6=AD=A2hook=E8=AF=B7=E6=B1=82=E4=B9=B1?= =?UTF-8?q?=E5=BA=8F=20(#2758)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/WebHook.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/WebHook.cpp b/server/WebHook.cpp index a3c8b71e..72ddb7fb 100755 --- a/server/WebHook.cpp +++ b/server/WebHook.cpp @@ -164,12 +164,16 @@ string getVhost(const HttpArgs &value) { return val != value.end() ? val->second : ""; } +static atomic s_hook_index { 0 }; + void do_http_hook(const string &url, const ArgsType &body, const function &func, uint32_t retry) { GET_CONFIG(string, mediaServerId, General::kMediaServerId); GET_CONFIG(float, hook_timeoutSec, Hook::kTimeoutSec); GET_CONFIG(float, retry_delay, Hook::kRetryDelay); const_cast(body)["mediaServerId"] = mediaServerId; + const_cast(body)["hook_index"] = s_hook_index++; + auto requester = std::make_shared(); requester->setMethod("POST"); auto bodyStr = to_string(body);