mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-22 10:40:05 +08:00
hook请求添加hook_index, 防止hook请求乱序 (#2758)
This commit is contained in:
parent
2e05119df1
commit
f69204b321
@ -164,12 +164,16 @@ string getVhost(const HttpArgs &value) {
|
||||
return val != value.end() ? val->second : "";
|
||||
}
|
||||
|
||||
static atomic<uint64_t> s_hook_index { 0 };
|
||||
|
||||
void do_http_hook(const string &url, const ArgsType &body, const function<void(const Value &, const string &)> &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<ArgsType &>(body)["mediaServerId"] = mediaServerId;
|
||||
const_cast<ArgsType &>(body)["hook_index"] = s_hook_index++;
|
||||
|
||||
auto requester = std::make_shared<HttpRequester>();
|
||||
requester->setMethod("POST");
|
||||
auto bodyStr = to_string(body);
|
||||
|
Loading…
Reference in New Issue
Block a user