From 5462934db6a495463f885bf58b85a4b9efe94b7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=EA=A6=AB=EA=A6=B6=EA=A6=8F=EA=A7=80=EA=A6=A6?= =?UTF-8?q?=EA=A6=BF=EA=A6=A7=EA=A6=AE=EA=A6=91=EA=A6=A9=EA=A6=AD=EA=A7=80?= Date: Sat, 19 Jun 2021 19:32:18 +0800 Subject: Tidy up a bit --- request.c | 7 ++----- 1 file 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); -- cgit v1.2.3