X-Git-Url: https://git.wpitchoune.net/gitweb/?a=blobdiff_plain;f=src%2Fhttp.c;h=43053edbcd7a02deb3a6917e827cb0eab557b5b5;hb=cc1552eda67ca81b48eb611535719f4548c00c9c;hp=55eab0fb6a54a534c61628dc5457d92a3f6a0621;hpb=1070b8de5c6cdf5e5958675a1b90f0af3e3f4688;p=prss.git diff --git a/src/http.c b/src/http.c index 55eab0f..43053ed 100644 --- a/src/http.c +++ b/src/http.c @@ -28,7 +28,7 @@ #include "http.h" -static int debug = 1; +static int debug; struct ucontent { char *data; @@ -77,7 +77,7 @@ char *http_get(const char *url, const char *content) if (content) { curl_easy_setopt(curl, CURLOPT_POSTFIELDS, content); curl_easy_setopt(curl, - CURLOPT_POSTFIELDSIZE, + CURLOPT_POSTFIELDSIZE, (long)strlen(content)); } curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, cbk_curl); @@ -104,14 +104,14 @@ json_object *http_json_get(const char *url, struct json_object *j) if (debug) printf("HTTP request= %s\n", json_object_to_json_string(j)); - + if (out) { result = json_tokener_parse(out); if (debug) printf("HTTP reply= %s\n", out); free(out); return result; - } + } return NULL; }