aboutsummaryrefslogtreecommitdiff
path: root/xs_httpd.h
diff options
context:
space:
mode:
authordefault <nobody@localhost>2024-03-09 08:32:20 +0100
committerdefault <nobody@localhost>2024-03-09 08:32:20 +0100
commit00b019b8902e9d319d855b9156f97f931923331c (patch)
tree3d17736c3884f119b3e223947bea31b6f5953ce1 /xs_httpd.h
parente12af777993ca655f285e852ad0dbee6bdca014f (diff)
Backport from xs.
Diffstat (limited to 'xs_httpd.h')
-rw-r--r--xs_httpd.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/xs_httpd.h b/xs_httpd.h
index b7f614c..4d006d7 100644
--- a/xs_httpd.h
+++ b/xs_httpd.h
@@ -98,15 +98,14 @@ void xs_httpd_response(FILE *f, int status, xs_dict *headers, xs_str *body, int
/* sends an httpd response */
{
xs *proto;
- xs_dict *p;
xs_str *k;
xs_val *v;
proto = xs_fmt("HTTP/1.1 %d %s", status, status / 100 == 2 ? "OK" : "ERROR");
fprintf(f, "%s\r\n", proto);
- p = headers;
- while (xs_dict_iter(&p, &k, &v)) {
+ int c = 0;
+ while (xs_dict_next(headers, &k, &v, &c)) {
fprintf(f, "%s: %s\r\n", k, v);
}