From 67ef4d7083c2873244d9f4fa40d51640c8002a38 Mon Sep 17 00:00:00 2001 From: Thomas Kolb Date: Sat, 17 Dec 2016 00:07:20 +0100 Subject: [PATCH] Fixed libmicrohttpd deprecation warnings --- src/main.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/src/main.c b/src/main.c index ee195d3..8bbbab3 100644 --- a/src/main.c +++ b/src/main.c @@ -224,7 +224,7 @@ int serv_regular_file(struct MHD_Connection *connection, struct ConnectionState } // no error so far -> serve the file - response = MHD_create_response_from_fd_at_offset( + response = MHD_create_response_from_fd_at_offset64( range.length, fd, range.start); @@ -782,29 +782,25 @@ int main(int argc, char ** argv) { init_signal_handlers(); // create the static response for error pages - error401Response = MHD_create_response_from_data( + error401Response = MHD_create_response_from_buffer( strlen(ERROR_401), (void*) ERROR_401, - MHD_NO, - MHD_NO); + MHD_RESPMEM_PERSISTENT); - error403Response = MHD_create_response_from_data( + error403Response = MHD_create_response_from_buffer( strlen(ERROR_403), (void*) ERROR_403, - MHD_NO, - MHD_NO); + MHD_RESPMEM_PERSISTENT); - error404Response = MHD_create_response_from_data( + error404Response = MHD_create_response_from_buffer( strlen(ERROR_404), (void*) ERROR_404, - MHD_NO, - MHD_NO); + MHD_RESPMEM_PERSISTENT); - error500Response = MHD_create_response_from_data( + error500Response = MHD_create_response_from_buffer( strlen(ERROR_500), (void*) ERROR_500, - MHD_NO, - MHD_NO); + MHD_RESPMEM_PERSISTENT); MHD_add_response_header(error401Response, MHD_HTTP_HEADER_CONTENT_TYPE, "text/html"); MHD_add_response_header(error403Response, MHD_HTTP_HEADER_CONTENT_TYPE, "text/html");