diff options
| author | grunfink <grunfink@comam.es> | 2025-10-24 05:12:44 +0200 |
|---|---|---|
| committer | grunfink <grunfink@comam.es> | 2025-10-24 05:12:44 +0200 |
| commit | ef4af726d73f09db8688034edd63f4ba1348485a (patch) | |
| tree | 7bed28e8a61eebe6525906df752f0c86cbdc2be1 | |
| parent | 1a42fdc8bd4d5dc045a87108e73dcda4f633266b (diff) | |
Added cast to curl_read_callback functions to mute warnings.
| -rw-r--r-- | xs_curl.h | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -125,11 +125,11 @@ xs_dict *xs_http_request(const char *method, const char *url, /* store response headers here */ curl_easy_setopt(curl, CURLOPT_HEADERDATA, &response); - curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, _header_callback); + curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, (curl_read_callback) _header_callback); struct _payload_data ipd = { NULL, 0, 0 }; curl_easy_setopt(curl, CURLOPT_WRITEDATA, &ipd); - curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, _data_callback); + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, (curl_read_callback) _data_callback); if (strcmp(method, "POST") == 0 || strcmp(method, "PUT") == 0) { 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, pd.offset = 0; curl_easy_setopt(curl, CURLOPT_READDATA, &pd); - curl_easy_setopt(curl, CURLOPT_READFUNCTION, _post_callback); + curl_easy_setopt(curl, CURLOPT_READFUNCTION, (curl_read_callback) _post_callback); } } @@ -232,7 +232,7 @@ int xs_smtp_request(const char *url, const char *user, const char *pass, curl_easy_setopt(curl, CURLOPT_MAIL_RCPT, rcpt); curl_easy_setopt(curl, CURLOPT_READDATA, &pd); - curl_easy_setopt(curl, CURLOPT_READFUNCTION, _post_callback); + curl_easy_setopt(curl, CURLOPT_READFUNCTION, (curl_read_callback) _post_callback); curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L); res = curl_easy_perform(curl); |