aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorJulien Dessaux2019-08-05 12:12:52 +0200
committerJulien Dessaux2019-08-05 13:28:55 +0200
commit1b43c74cd2159e8e99ff87dfc92303ac10c85d57 (patch)
tree1b68b88fe2a6ee73d08448fc3bcb6c962f5ffc4b /common
parentFixed curl call orders (diff)
downloadrocket-cli-client-1b43c74cd2159e8e99ff87dfc92303ac10c85d57.tar.gz
rocket-cli-client-1b43c74cd2159e8e99ff87dfc92303ac10c85d57.tar.bz2
rocket-cli-client-1b43c74cd2159e8e99ff87dfc92303ac10c85d57.zip
Fixed lib curl hanging because of a post without payload
Diffstat (limited to 'common')
-rw-r--r--common/http.c6
1 files changed, 4 insertions, 2 deletions
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);
}