From 62cc2f4ac6cb45c280b70a98891a51a2d3b55520 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20Luka=20=C5=A0ijanec?= Date: Tue, 19 Jul 2022 20:37:49 +0200 Subject: 0.0.24 --- debian/changelog | 6 ++++++ src/httpd.c | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 3e4973e..bdfe233 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +sear.c (0.0.24-1) stable; urgency=low + + * fixed favicon sending + + -- Anton Luka Šijanec Tue, 19 Jul 2022 20:30:00 +0200 + sear.c (0.0.23-1) stable; urgency=low * added a hreflink with window.external.AddSearchProvider (for palemoon) 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 ? "" : " -->"); + 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); -- cgit v1.2.3