mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-13 00:04:53 +00:00
asterisk: Add macro for curl user agent.
Currently, each module that uses libcurl duplicates the standard Asterisk curl user agent. This adds a global macro for the Asterisk user agent used for curl requests to eliminate this duplication. ASTERISK-29861 #close Change-Id: I9fc37935980384b4daf96ae54fa3c9adb962ed2d
This commit is contained in:
committed by
Kevin Harwell
parent
1633410161
commit
e26b57984f
@@ -31,9 +31,6 @@
|
||||
/* Used to check CURL headers */
|
||||
#define MAX_HEADER_LENGTH 1023
|
||||
|
||||
/* Used for CURL requests */
|
||||
#define GLOBAL_USERAGENT "asterisk-libcurl-agent/1.0"
|
||||
|
||||
/* CURL callback data to avoid storing useless info in AstDB */
|
||||
struct curl_cb_data {
|
||||
char *cache_control;
|
||||
@@ -144,7 +141,7 @@ static CURL *get_curl_instance(struct curl_cb_data *data)
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1);
|
||||
curl_easy_setopt(curl, CURLOPT_TIMEOUT, curl_timeout);
|
||||
curl_easy_setopt(curl, CURLOPT_USERAGENT, GLOBAL_USERAGENT);
|
||||
curl_easy_setopt(curl, CURLOPT_USERAGENT, AST_CURL_USER_AGENT);
|
||||
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);
|
||||
curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, curl_header_callback);
|
||||
curl_easy_setopt(curl, CURLOPT_HEADERDATA, data);
|
||||
|
Reference in New Issue
Block a user