aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2015-12-12 12:15:39 +0100
committerGravatar Christian Hesse <mail@eworm.de>2015-12-12 12:15:39 +0100
commitc072c7e9947ea85df6ee6b34c813f2b1a56cb393 (patch)
tree68bcb8fb2ab765857c82172a181417df2c1ee8bb
parentd7e41016af9ba005390469cabd8e5cda1360b90e (diff)
downloadpaccache-c072c7e9947ea85df6ee6b34c813f2b1a56cb393.tar.gz
paccache-c072c7e9947ea85df6ee6b34c813f2b1a56cb393.tar.zst
use MHD_create_response_from_buffer()
MHD_create_response_from_data() is deprecated, so use MHD_create_response_from_buffer() instead.
-rw-r--r--pacredir.c4
1 files 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);