1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

HTTP user-agent is now a project wide compile-time constant

This commit is contained in:
Steffen Vogel 2017-01-19 21:03:37 -02:00
parent f505e6cb7f
commit 59816b3747
2 changed files with 3 additions and 1 deletions

View file

@ -37,6 +37,8 @@
#define SYSFS_PATH "/sys"
#define PROCFS_PATH "/proc"
#define USER_AGENT "VILLASnode " VERSION
/* Required kernel version */
#define KERNEL_VERSION_MAJ 3
#define KERNEL_VERSION_MIN 6

View file

@ -475,13 +475,13 @@ int ngsi_open(struct node *n)
if (i->tfd < 0)
serror("Failed to create timer");
i->headers = curl_slist_append(i->headers, "User-Agent: VILLASnode " VERSION);
i->headers = curl_slist_append(i->headers, "Accept: application/json");
i->headers = curl_slist_append(i->headers, "Content-Type: application/json");
curl_easy_setopt(i->curl, CURLOPT_SSL_VERIFYPEER, i->ssl_verify);
curl_easy_setopt(i->curl, CURLOPT_TIMEOUT_MS, i->timeout * 1e3);
curl_easy_setopt(i->curl, CURLOPT_HTTPHEADER, i->headers);
curl_easy_setopt(i->curl, CURLOPT_USERAGENT, USER_AGENT);
/* Create entity and atributes */
json_t *entity = ngsi_build_entity(i, NULL, 0, NGSI_ENTITY_METADATA);