Fixed libmicrohttpd deprecation warnings

This commit is contained in:
Thomas Kolb 2016-12-17 00:07:20 +01:00
parent 10e9289921
commit 67ef4d7083

View file

@ -224,7 +224,7 @@ int serv_regular_file(struct MHD_Connection *connection, struct ConnectionState
} }
// no error so far -> serve the file // 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, range.length,
fd, fd,
range.start); range.start);
@ -782,29 +782,25 @@ int main(int argc, char ** argv) {
init_signal_handlers(); init_signal_handlers();
// create the static response for error pages // create the static response for error pages
error401Response = MHD_create_response_from_data( error401Response = MHD_create_response_from_buffer(
strlen(ERROR_401), strlen(ERROR_401),
(void*) ERROR_401, (void*) ERROR_401,
MHD_NO, MHD_RESPMEM_PERSISTENT);
MHD_NO);
error403Response = MHD_create_response_from_data( error403Response = MHD_create_response_from_buffer(
strlen(ERROR_403), strlen(ERROR_403),
(void*) ERROR_403, (void*) ERROR_403,
MHD_NO, MHD_RESPMEM_PERSISTENT);
MHD_NO);
error404Response = MHD_create_response_from_data( error404Response = MHD_create_response_from_buffer(
strlen(ERROR_404), strlen(ERROR_404),
(void*) ERROR_404, (void*) ERROR_404,
MHD_NO, MHD_RESPMEM_PERSISTENT);
MHD_NO);
error500Response = MHD_create_response_from_data( error500Response = MHD_create_response_from_buffer(
strlen(ERROR_500), strlen(ERROR_500),
(void*) ERROR_500, (void*) ERROR_500,
MHD_NO, MHD_RESPMEM_PERSISTENT);
MHD_NO);
MHD_add_response_header(error401Response, MHD_HTTP_HEADER_CONTENT_TYPE, "text/html"); MHD_add_response_header(error401Response, MHD_HTTP_HEADER_CONTENT_TYPE, "text/html");
MHD_add_response_header(error403Response, MHD_HTTP_HEADER_CONTENT_TYPE, "text/html"); MHD_add_response_header(error403Response, MHD_HTTP_HEADER_CONTENT_TYPE, "text/html");