diff options
Diffstat (limited to 'xs_curl.h')
| -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, | |||
| 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); |