From c072c7e9947ea85df6ee6b34c813f2b1a56cb393 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Sat, 12 Dec 2015 12:15:39 +0100 Subject: use MHD_create_response_from_buffer() MHD_create_response_from_data() is deprecated, so use MHD_create_response_from_buffer() instead. --- pacredir.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pacredir.c b/pacredir.c index fa6405d..01d47a2 100644 --- a/pacredir.c +++ b/pacredir.c @@ -445,7 +445,7 @@ response: write_log(stdout, "Redirecting to %s\n", url); page = malloc(strlen(PAGE307) + strlen(url) + strlen(basename) + 1); sprintf(page, PAGE307, url, basename); - response = MHD_create_response_from_data(strlen(page), (void*) page, MHD_NO, MHD_NO); + response = MHD_create_response_from_buffer(strlen(page), (void*) page, MHD_RESPMEM_PERSISTENT); ret = MHD_add_response_header(response, "Location", url); ret = MHD_queue_response(connection, MHD_HTTP_TEMPORARY_REDIRECT, response); free(url); @@ -458,7 +458,7 @@ response: write_log(stdout, "File %s not found on %d servers, giving up.\n", basename, req_count + 1); page = malloc(strlen(PAGE404) + strlen(basename) + 1); sprintf(page, PAGE404, basename); - response = MHD_create_response_from_data(strlen(page), (void*) page, MHD_NO, MHD_NO); + response = MHD_create_response_from_buffer(strlen(page), (void*) page, MHD_RESPMEM_PERSISTENT); ret = MHD_queue_response(connection, MHD_HTTP_NOT_FOUND, response); } MHD_destroy_response(response); -- cgit v1.2.3-70-g09d2