Update jansson subtree to latest revision
This commit is contained in:
5
deps/jansson/doc/apiref.rst
vendored
5
deps/jansson/doc/apiref.rst
vendored
@@ -150,6 +150,11 @@ functions:
|
||||
Returns true for types ``JSON_TRUE`` and ``JSON_FALSE``, and false
|
||||
for values of other types and for *NULL*.
|
||||
|
||||
.. function:: json_boolean_value(const json_t *json)
|
||||
|
||||
Alias of :func:`json_is_true()`, i.e. returns 1 for ``JSON_TRUE``
|
||||
and 0 otherwise.
|
||||
|
||||
|
||||
.. _apiref-reference-count:
|
||||
|
||||
|
9
deps/jansson/doc/github_commits.c
vendored
9
deps/jansson/doc/github_commits.c
vendored
@@ -53,6 +53,7 @@ static char *request(const char *url)
|
||||
{
|
||||
CURL *curl = NULL;
|
||||
CURLcode status;
|
||||
struct curl_slist *headers = NULL;
|
||||
char *data = NULL;
|
||||
long code;
|
||||
|
||||
@@ -71,6 +72,11 @@ static char *request(const char *url)
|
||||
};
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_URL, url);
|
||||
|
||||
/* GitHub commits API v3 requires a User-Agent header */
|
||||
headers = curl_slist_append(headers, "User-Agent: Jansson-Tutorial");
|
||||
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_response);
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &write_result);
|
||||
|
||||
@@ -90,6 +96,7 @@ static char *request(const char *url)
|
||||
}
|
||||
|
||||
curl_easy_cleanup(curl);
|
||||
curl_slist_free_all(headers);
|
||||
curl_global_cleanup();
|
||||
|
||||
/* zero-terminate the result */
|
||||
@@ -102,6 +109,8 @@ error:
|
||||
free(data);
|
||||
if(curl)
|
||||
curl_easy_cleanup(curl);
|
||||
if(headers)
|
||||
curl_slist_free_all(headers);
|
||||
curl_global_cleanup();
|
||||
return NULL;
|
||||
}
|
||||
|
Reference in New Issue
Block a user