aboutsummaryrefslogtreecommitdiff
path: root/src/microhttpd/response.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2018-11-08 14:53:19 +0100
committerChristian Grothoff <christian@grothoff.org>2018-11-08 14:53:19 +0100
commit10bdf39505cf525b95886c140b3c2e82e7427d29 (patch)
tree03aec14ac7204ed93ce286770c180fcbae8c2c8a /src/microhttpd/response.c
parent3fc686e335437ec5f6d6270c8d713e9a01da966f (diff)
downloadlibmicrohttpd-10bdf39505cf525b95886c140b3c2e82e7427d29.tar.gz
libmicrohttpd-10bdf39505cf525b95886c140b3c2e82e7427d29.zip
add MHD_create_response_from_buffer_with_free_callback
Diffstat (limited to 'src/microhttpd/response.c')
-rw-r--r--src/microhttpd/response.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/microhttpd/response.c b/src/microhttpd/response.c
index d7835c20..08b7805d 100644
--- a/src/microhttpd/response.c
+++ b/src/microhttpd/response.c
@@ -701,6 +701,34 @@ MHD_create_response_from_buffer (size_t size,
701} 701}
702 702
703 703
704/**
705 * Create a response object. The response object can be extended with
706 * header information and then be used any number of times.
707 *
708 * @param size size of the data portion of the response
709 * @param buffer size bytes containing the response's data portion
710 * @param crfc function to call to free the @a buffer
711 * @return NULL on error (i.e. invalid arguments, out of memory)
712 * @ingroup response
713 */
714_MHD_EXTERN struct MHD_Response *
715MHD_create_response_from_buffer_with_free_callback (size_t size,
716 void *buffer,
717 MHD_ContentReaderFreeCallback crfc)
718{
719 struct MHD_Response *r;
720
721 r = MHD_create_response_from_data (size,
722 buffer,
723 GNUNET_YES,
724 GNUNET_NO);
725 if (NULL == r)
726 return r;
727 r->crfc = crfc;
728 return r;
729}
730
731
704#ifdef UPGRADE_SUPPORT 732#ifdef UPGRADE_SUPPORT
705/** 733/**
706 * This connection-specific callback is provided by MHD to 734 * This connection-specific callback is provided by MHD to