summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2021-06-19 19:32:18 +0800
committerꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2021-06-19 19:32:46 +0800
commit5462934db6a495463f885bf58b85a4b9efe94b7a (patch)
tree926a47c6c43ced25500be0212a074836a7dbb46d
parentded922b3f8cceabcdadf519b1ad233774d9f0a45 (diff)
Tidy up a bit
-rw-r--r--request.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/request.c b/request.c
index e2fed5a..3e0b857 100644
--- a/request.c
+++ b/request.c
@@ -116,8 +116,8 @@ void request(void (*handler)(icclient_response *), void (*callback)(void *), str
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, append);
icclient_response *response = malloc(sizeof(icclient_response));
response->data = malloc(1);
- response->userData = callback;
response->numBytes = 0;
+ response->userData = callback;
curl_easy_setopt(curl, CURLOPT_WRITEDATA, response);
struct curl_httppost *post, *last = NULL;
if (body) {
@@ -125,10 +125,7 @@ void request(void (*handler)(icclient_response *), void (*callback)(void *), str
struct pair pair = body->pairs[i];
if (!pair.value)
continue;
- curl_formadd(&post, &last,
- CURLFORM_COPYNAME, pair.key,
- CURLFORM_PTRCONTENTS, pair.value,
- CURLFORM_END);
+ curl_formadd(&post, &last, CURLFORM_COPYNAME, pair.key, CURLFORM_PTRCONTENTS, pair.value, CURLFORM_END);
}
last = NULL;
curl_easy_setopt(curl, CURLOPT_HTTPPOST, post);