X-Git-Url: https://git.wpitchoune.net/gitweb/?p=prss.git;a=blobdiff_plain;f=src%2Fphttp.c;h=a1d02118046ce3f6217ef19e00af6ff9c6673b12;hp=81c8ad76e81ade74a4d8977c69e88e674c2e7c73;hb=2acb4f4b249348eeb6ca4bf37836889be55418ff;hpb=fd2d79da502acb8dcb4589413b7f529c762997f1 diff --git a/src/phttp.c b/src/phttp.c index 81c8ad7..a1d0211 100644 --- a/src/phttp.c +++ b/src/phttp.c @@ -103,8 +103,10 @@ static json_object *post(const char *url, const char *body) curl_easy_setopt(curl, CURLOPT_URL, url); curl_easy_setopt(curl, CURLOPT_VERBOSE, 0); - curl_easy_setopt(curl, CURLOPT_POSTFIELDS, body); - curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, (long)strlen(body)); + if (body) { + curl_easy_setopt(curl, CURLOPT_POSTFIELDS, body); + curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, (long)strlen(body)); + } curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, cbk_curl); curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)&chunk);