summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/httpd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/httpd.c b/src/httpd.c
index abe025a..0171a11 100644
--- a/src/httpd.c
+++ b/src/httpd.c
@@ -134,6 +134,7 @@ enum MHD_Result sc_httpd (void * cls,
l ? "<input type=hidden name=l value=" : "<!-- Odgovor na dokončno vprašanje o Življenju, Vesolju in sploh Vsem je ",
l ? atoi(l) : 42,
l ? " />" : " -->");
+ size_t response_len = 0;
if (!query) {
if (url[0] == '/')
switch (url[1]) {
@@ -161,6 +162,7 @@ enum MHD_Result sc_httpd (void * cls,
case 'f': /* favicon.ico */
mhdrmm = MHD_RESPMEM_PERSISTENT;
response = (char *) sc_ico;
+ response_len = sizeof sc_ico;
content_type = "image/x-icon";
break;
case 'l': /* logs.html */
@@ -256,7 +258,7 @@ retry:
} else goto retry;
}
}
- httpd_response = MHD_create_response_from_buffer (strlen(response), (void *) response, mhdrmm);
+ httpd_response = MHD_create_response_from_buffer (response_len ? response_len : strlen(response), (void *) response, mhdrmm);
MHD_add_response_header(httpd_response, "Content-Type", content_type);
if (status_code >= 300 && status_code <= 399)
MHD_add_response_header(httpd_response, "Location", location);