summaryrefslogtreecommitdiff
path: root/xs_curl.h
diff options
context:
space:
mode:
authorGravatar grunfink2025-10-24 05:12:44 +0200
committerGravatar grunfink2025-10-24 05:12:44 +0200
commitef4af726d73f09db8688034edd63f4ba1348485a (patch)
tree7bed28e8a61eebe6525906df752f0c86cbdc2be1 /xs_curl.h
parentKeep track of deleted users and return 410 Gone for them. (diff)
downloadsnac2-ef4af726d73f09db8688034edd63f4ba1348485a.tar.gz
snac2-ef4af726d73f09db8688034edd63f4ba1348485a.tar.xz
snac2-ef4af726d73f09db8688034edd63f4ba1348485a.zip
Added cast to curl_read_callback functions to mute warnings.
Diffstat (limited to 'xs_curl.h')
-rw-r--r--xs_curl.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/xs_curl.h b/xs_curl.h
index 2301661..16b022a 100644
--- a/xs_curl.h
+++ b/xs_curl.h
@@ -125,11 +125,11 @@ xs_dict *xs_http_request(const char *method, const char *url,
125 125
126 /* store response headers here */ 126 /* store response headers here */
127 curl_easy_setopt(curl, CURLOPT_HEADERDATA, &response); 127 curl_easy_setopt(curl, CURLOPT_HEADERDATA, &response);
128 curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, _header_callback); 128 curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, (curl_read_callback) _header_callback);
129 129
130 struct _payload_data ipd = { NULL, 0, 0 }; 130 struct _payload_data ipd = { NULL, 0, 0 };
131 curl_easy_setopt(curl, CURLOPT_WRITEDATA, &ipd); 131 curl_easy_setopt(curl, CURLOPT_WRITEDATA, &ipd);
132 curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, _data_callback); 132 curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, (curl_read_callback) _data_callback);
133 133
134 if (strcmp(method, "POST") == 0 || strcmp(method, "PUT") == 0) { 134 if (strcmp(method, "POST") == 0 || strcmp(method, "PUT") == 0) {
135 CURLoption curl_method = method[1] == 'O' ? CURLOPT_POST : CURLOPT_UPLOAD; 135 CURLoption curl_method = method[1] == 'O' ? CURLOPT_POST : CURLOPT_UPLOAD;
@@ -147,7 +147,7 @@ xs_dict *xs_http_request(const char *method, const char *url,
147 pd.offset = 0; 147 pd.offset = 0;
148 148
149 curl_easy_setopt(curl, CURLOPT_READDATA, &pd); 149 curl_easy_setopt(curl, CURLOPT_READDATA, &pd);
150 curl_easy_setopt(curl, CURLOPT_READFUNCTION, _post_callback); 150 curl_easy_setopt(curl, CURLOPT_READFUNCTION, (curl_read_callback) _post_callback);
151 } 151 }
152 } 152 }
153 153
@@ -232,7 +232,7 @@ int xs_smtp_request(const char *url, const char *user, const char *pass,
232 curl_easy_setopt(curl, CURLOPT_MAIL_RCPT, rcpt); 232 curl_easy_setopt(curl, CURLOPT_MAIL_RCPT, rcpt);
233 233
234 curl_easy_setopt(curl, CURLOPT_READDATA, &pd); 234 curl_easy_setopt(curl, CURLOPT_READDATA, &pd);
235 curl_easy_setopt(curl, CURLOPT_READFUNCTION, _post_callback); 235 curl_easy_setopt(curl, CURLOPT_READFUNCTION, (curl_read_callback) _post_callback);
236 curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L); 236 curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);
237 237
238 res = curl_easy_perform(curl); 238 res = curl_easy_perform(curl);