diff options
author | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2021-06-19 19:32:18 +0800 |
---|---|---|
committer | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2021-06-19 19:32:46 +0800 |
commit | 5462934db6a495463f885bf58b85a4b9efe94b7a (patch) | |
tree | 926a47c6c43ced25500be0212a074836a7dbb46d | |
parent | ded922b3f8cceabcdadf519b1ad233774d9f0a45 (diff) |
Tidy up a bit
-rw-r--r-- | request.c | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -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); |