Better coping with timeouts.

This commit is contained in:
default 2022-09-28 16:27:53 +02:00
parent a22a515e0f
commit 7ae3064210
2 changed files with 7 additions and 1 deletions

2
html.c
View file

@ -458,7 +458,7 @@ d_char *html_entry(snac *snac, d_char *s, char *msg, xs_set *seen, int level)
if (url != NULL) { if (url != NULL) {
xs *s1 = xs_fmt("<p><img src=\"%s\" alt=\"%s\"/></p>\n", xs *s1 = xs_fmt("<p><img src=\"%s\" alt=\"%s\"/></p>\n",
url, name == NULL ? "" : name); url, xs_is_null(name) ? "" : name);
s = xs_str_cat(s, s1); s = xs_str_cat(s, s1);
} }

View file

@ -106,6 +106,12 @@ void httpd_connection(int rs)
req = xs_httpd_request(f, &payload, &p_size); req = xs_httpd_request(f, &payload, &p_size);
if (req == NULL) {
/* probably because a timeout */
fclose(f);
return;
}
method = xs_dict_get(req, "method"); method = xs_dict_get(req, "method");
q_path = xs_dup(xs_dict_get(req, "path")); q_path = xs_dup(xs_dict_get(req, "path"));