From 1b43c74cd2159e8e99ff87dfc92303ac10c85d57 Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Mon, 5 Aug 2019 12:12:52 +0200 Subject: Fixed lib curl hanging because of a post without payload --- common/http.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'common') diff --git a/common/http.c b/common/http.c index 88e15cd..0a87b6a 100644 --- a/common/http.c +++ b/common/http.c @@ -109,8 +109,10 @@ const char * http_post(const char* path, const char* postfields) curl_easy_reset(curl); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, &writeCallback); - if (postfields == NULL) - curl_easy_setopt(curl, CURLOPT_POST, 1); + if (postfields == NULL) { + curl_easy_setopt(curl, CURLOPT_POST, 1L); + curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, 0L); + } return http_perform(path, postfields); } -- cgit v1.2.3