|
@@ -125,11 +125,11 @@ xs_dict *xs_http_request(const char *method, const char *url,
|
|
|
|
|
|
|
|
/* store response headers here */
|
|
/* store response headers here */
|
|
|
curl_easy_setopt(curl, CURLOPT_HEADERDATA, &response);
|
|
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 };
|
|
struct _payload_data ipd = { NULL, 0, 0 };
|
|
|
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &ipd);
|
|
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) {
|
|
if (strcmp(method, "POST") == 0 || strcmp(method, "PUT") == 0) {
|
|
|
CURLoption curl_method = method[1] == 'O' ? CURLOPT_POST : CURLOPT_UPLOAD;
|
|
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;
|
|
pd.offset = 0;
|
|
|
|
|
|
|
|
curl_easy_setopt(curl, CURLOPT_READDATA, &pd);
|
|
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_MAIL_RCPT, rcpt);
|
|
|
|
|
|
|
|
curl_easy_setopt(curl, CURLOPT_READDATA, &pd);
|
|
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);
|
|
curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);
|
|
|
|
|
|
|
|
res = curl_easy_perform(curl);
|
|
res = curl_easy_perform(curl);
|