diff options
author | default <nobody@localhost> | 2024-03-09 08:44:48 +0100 |
---|---|---|
committer | default <nobody@localhost> | 2024-03-09 08:44:48 +0100 |
commit | 91bb0615d982d1adcc5680c346f9510905464584 (patch) | |
tree | 5433a2dcdc2cc34115b76570bdc63b49429093bc | |
parent | 00b019b8902e9d319d855b9156f97f931923331c (diff) |
Replaced most xs_dict_iter() with xs_dict_next().
-rw-r--r-- | activitypub.c | 3 | ||||
-rw-r--r-- | html.c | 6 | ||||
-rw-r--r-- | httpd.c | 3 | ||||
-rw-r--r-- | mastoapi.c | 3 | ||||
-rw-r--r-- | utils.c | 3 |
5 files changed, 12 insertions, 6 deletions
diff --git a/activitypub.c b/activitypub.c index f754ee0..1976012 100644 --- a/activitypub.c +++ b/activitypub.c @@ -1221,7 +1221,8 @@ xs_dict *msg_actor(snac *snac) xs_str *k; xs_str *v; - while (xs_dict_iter(&metadata, &k, &v)) { + int c = 0; + while (xs_dict_next(metadata, &k, &v, &c)) { xs *d = xs_dict_new(); xs *k2 = encode_html(k); @@ -779,7 +779,8 @@ static xs_html *html_user_body(snac *user, int read_only) xs_html *snac_metadata = xs_html_tag("div", xs_html_attr("class", "snac-metadata")); - while (xs_dict_iter(&metadata, &k, &v)) { + int c = 0; + while (xs_dict_next(metadata, &k, &v, &c)) { xs_html *value; if (xs_startswith(v, "https:/" "/")) { @@ -944,7 +945,8 @@ xs_html *html_top_controls(snac *snac) xs_str *k; xs_str *v; - while (xs_dict_iter(&md, &k, &v)) { + int c = 0; + while (xs_dict_next(md, &k, &v, &c)) { xs *kp = xs_fmt("%s=%s", k, v); if (*metadata) @@ -403,7 +403,8 @@ void httpd_connection(FILE *f) xs_dict *more_headers = xs_dict_get(srv_config, "http_headers"); if (xs_type(more_headers) == XSTYPE_DICT) { char *k, *v; - while (xs_dict_iter(&more_headers, &k, &v)) + int c = 0; + while (xs_dict_next(more_headers, &k, &v, &c)) headers = xs_dict_set(headers, k, v); } @@ -1172,7 +1172,8 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path, if (xs_is_null(val_links)) val_links = xs_stock_dict; - while (xs_dict_iter(&metadata, &k, &v)) { + int c = 0; + while (xs_dict_next(metadata, &k, &v, &c)) { xs *val_date = NULL; xs_number *verified_time = xs_dict_get(val_links, v); @@ -423,7 +423,8 @@ void verify_links(snac *user) headers = xs_dict_append(headers, "accept", "text/html"); headers = xs_dict_append(headers, "user-agent", USER_AGENT " (link verify)"); - while (p && xs_dict_iter(&p, &k, &v)) { + int c = 0; + while (p && xs_dict_next(p, &k, &v, &c)) { /* not an https link? skip */ if (!xs_startswith(v, "https:/" "/")) continue; |