summaryrefslogtreecommitdiff
path: root/xs_curl.h
diff options
context:
space:
mode:
authorGravatar default2024-03-09 08:32:20 +0100
committerGravatar default2024-03-09 08:32:20 +0100
commit00b019b8902e9d319d855b9156f97f931923331c (patch)
tree3d17736c3884f119b3e223947bea31b6f5953ce1 /xs_curl.h
parentBackport from xs. (diff)
downloadpenes-snac2-00b019b8902e9d319d855b9156f97f931923331c.tar.gz
penes-snac2-00b019b8902e9d319d855b9156f97f931923331c.tar.xz
penes-snac2-00b019b8902e9d319d855b9156f97f931923331c.zip
Backport from xs.
Diffstat (limited to '')
-rw-r--r--xs_curl.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/xs_curl.h b/xs_curl.h
index b08d902..f7783b9 100644
--- a/xs_curl.h
+++ b/xs_curl.h
@@ -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);