diff options
| author | 2024-03-09 08:32:20 +0100 | |
|---|---|---|
| committer | 2024-03-09 08:32:20 +0100 | |
| commit | 00b019b8902e9d319d855b9156f97f931923331c (patch) | |
| tree | 3d17736c3884f119b3e223947bea31b6f5953ce1 /xs_curl.h | |
| parent | Backport from xs. (diff) | |
| download | penes-snac2-00b019b8902e9d319d855b9156f97f931923331c.tar.gz penes-snac2-00b019b8902e9d319d855b9156f97f931923331c.tar.xz penes-snac2-00b019b8902e9d319d855b9156f97f931923331c.zip | |
Backport from xs.
Diffstat (limited to '')
| -rw-r--r-- | xs_curl.h | 5 |
1 files changed, 2 insertions, 3 deletions
| @@ -93,7 +93,6 @@ xs_dict *xs_http_request(const char *method, const char *url, | |||
| 93 | xs_dict *response; | 93 | xs_dict *response; |
| 94 | CURL *curl; | 94 | CURL *curl; |
| 95 | struct curl_slist *list = NULL; | 95 | struct curl_slist *list = NULL; |
| 96 | xs_dict *p; | ||
| 97 | xs_str *k; | 96 | xs_str *k; |
| 98 | xs_val *v; | 97 | xs_val *v; |
| 99 | long lstatus = 0; | 98 | long lstatus = 0; |
| @@ -147,8 +146,8 @@ xs_dict *xs_http_request(const char *method, const char *url, | |||
| 147 | } | 146 | } |
| 148 | 147 | ||
| 149 | /* fill the request headers */ | 148 | /* fill the request headers */ |
| 150 | p = (xs_dict *)headers; | 149 | int c = 0; |
| 151 | while (xs_dict_iter(&p, &k, &v)) { | 150 | while (xs_dict_next(headers, &k, &v, &c)) { |
| 152 | xs *h = xs_fmt("%s: %s", k, v); | 151 | xs *h = xs_fmt("%s: %s", k, v); |
| 153 | 152 | ||
| 154 | list = curl_slist_append(list, h); | 153 | list = curl_slist_append(list, h); |