libmicrohttpd

HTTP/1.x server C library (MHD 1.x, stable)
Log | Files | Refs | Submodules | README | LICENSE

commit e33528862ac09ae22d06baaf1d3b92d973dd2b22
parent 7054ad4d559d630034eb511201131a3567110cbb
Author: ng0 <ng0@n0.is>
Date:   Mon, 22 Jul 2019 14:18:35 +0000

Merge remote-tracking branch 'origin/master' into dev/ng0/gsoc2019

Diffstat:
MChangeLog | 5+----
Mdoc/libmicrohttpd.texi | 8--------
Msrc/include/microhttpd.h | 40+++++++++++++++-------------------------
Msrc/microhttpd/response.c | 10+---------
4 files changed, 17 insertions(+), 46 deletions(-)

diff --git a/ChangeLog b/ChangeLog @@ -1,6 +1,3 @@ -Mon 22 Jul 2019 11:49:03 AM CEST - Introduce MHD_RO_FREE_FUNCTION. -NM/CG - Tue Jul 16 19:56:14 CEST 2019 Add MHD_OPTION_HTTPS_CERT_CALLBACK2 to allow OCSP stapling and MHD_FEATURE_HTTPS_CERT_CALLBACK2 to check for. -TR @@ -105,7 +102,7 @@ Sun Apr 21 16:40:00 MSK 2019 Fri Apr 19 23:00:00 MSK 2019 Rewritten SHA-256 calculations from scratch to avoid changing LGPL version; - Added usage of GCC/Clang built-ins for bytes swap to significantly improve + Added usage of GCC/Clang built-ins for bytes swap to significantly improve speed of MD5 and SHA-256 calculation on platforms with known endianness. Added test for SHA-256 calculations. -EG diff --git a/doc/libmicrohttpd.texi b/doc/libmicrohttpd.texi @@ -1219,14 +1219,6 @@ Response-specific options. Passed in the varargs portion of @item MHD_RO_END No more options / last option. This is used to terminate the VARARGs list. - -@item MHD_RO_FREE_FUNCTION -Use a custom function for freeing the memory passed when using -@code{MHD_create_response_from_buffer} with -@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_ContentReaderFreeCallback}. @end table @end deftp diff --git a/src/include/microhttpd.h b/src/include/microhttpd.h @@ -132,7 +132,7 @@ typedef intptr_t ssize_t; * Current version of the library. * 0x01093001 = 1.9.30-1. */ -#define MHD_VERSION 0x00096503 +#define MHD_VERSION 0x00096502 /** * MHD-internal return code for "YES". @@ -2256,12 +2256,10 @@ 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. - * - * It is also used as a va_arg in #MHD_set_response_options() in combination - * with #MHD_RO_FREE_FUNCTION. + * 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. * * @param cls closure * @ingroup response @@ -2680,7 +2678,7 @@ _MHD_EXTERN int MHD_set_connection_value (struct MHD_Connection *connection, enum MHD_ValueKind kind, const char *key, - const char *value); + const char *value); /** @@ -2710,11 +2708,11 @@ MHD_set_connection_value (struct MHD_Connection *connection, */ int MHD_set_connection_value_n (struct MHD_Connection *connection, - enum MHD_ValueKind kind, - const char *key, + enum MHD_ValueKind kind, + const char *key, size_t key_size, - const char *value, - size_t value_size); + const char *value, + size_t value_size); /** @@ -2808,7 +2806,7 @@ MHD_lookup_connection_value_n (struct MHD_Connection *connection, _MHD_EXTERN int MHD_queue_response (struct MHD_Connection *connection, unsigned int status_code, - struct MHD_Response *response); + struct MHD_Response *response); /** @@ -2897,18 +2895,10 @@ enum MHD_ResponseFlags */ enum MHD_ResponseOptions { - - /** - * End of the list of options. - */ - MHD_RO_END = 0, - - /** - * Set a specific free() function - * to free response buffer instead of libc void free(void * ptr) - */ - MHD_RO_FREE_FUNCTION = 1 - + /** + * End of the list of options. + */ + MHD_RO_END = 0 }; diff --git a/src/microhttpd/response.c b/src/microhttpd/response.c @@ -400,6 +400,7 @@ MHD_create_response_from_callback (uint64_t size, return response; } + /** * Set special flags and options for a response. * @@ -424,15 +425,6 @@ MHD_set_response_options (struct MHD_Response *response, { switch (ro) { - case MHD_RO_FREE_FUNCTION: - va_start (ap, flags); - if (NULL != (response->crfc = va_arg (ap, MHD_ContentReaderFreeCallback))) { - ret = MHD_YES; - } else { - ret = MHD_NO; - } - va_end (ap); - break; default: ret = MHD_NO; break;