summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);