diff --git a/doc/libmicrohttpd.texi b/doc/libmicrohttpd.texi index aa3f0242..242e338b 100644 --- a/doc/libmicrohttpd.texi +++ b/doc/libmicrohttpd.texi @@ -1226,7 +1226,7 @@ Use a custom function for freeing the memory passed when using @code{MHD_RESPMEM_MUST_FREE}. This replaces the use of libc's @code{free()} function to release the memory with an implementation provided by the application. The next argument must be of type -@code{MHD_FreeFunction}. +@code{MHD_ContentReaderFreeCallback}. @end table @end deftp diff --git a/src/include/microhttpd.h b/src/include/microhttpd.h index 34f82154..93382152 100644 --- a/src/include/microhttpd.h +++ b/src/include/microhttpd.h @@ -2256,10 +2256,12 @@ typedef ssize_t /** - * This method is called by libmicrohttpd if we - * are done with a content reader. It should - * be used to free resources associated with the - * content reader. + * This method is called by libmicrohttpd if we are done with a content + * reader. It should be used to free resources associated with the content + * reader. + * + * It is also used as a va_arg in #MHD_set_response_options() in combination + * with #MHD_RO_FREE_FUNCTION. * * @param cls closure * @ingroup response @@ -2910,15 +2912,6 @@ enum MHD_ResponseOptions }; -/** - * This typedef is defined to be able to pass a function pointer - * as a va_arg in #MHD_set_response_options() in combination - * with #MHD_RO_FREE_FUNCTION. - */ -typedef void -(*MHD_FreeFunction)(void *); - - /** * Set special flags and options for a response. * diff --git a/src/microhttpd/response.c b/src/microhttpd/response.c index 21be419b..e9d5a4bf 100644 --- a/src/microhttpd/response.c +++ b/src/microhttpd/response.c @@ -426,7 +426,7 @@ MHD_set_response_options (struct MHD_Response *response, { case MHD_RO_FREE_FUNCTION: va_start (ap, flags); - if (NULL != (response->crfc = va_arg (ap, MHD_free_ptr))) { + if (NULL != (response->crfc = va_arg (ap, MHD_ContentReaderFreeCallback))) { ret = MHD_YES; } else { ret = MHD_NO;