aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-07-22 16:11:10 +0200
committerChristian Grothoff <christian@grothoff.org>2019-07-22 16:11:10 +0200
commit092b370587ff9dd258f52206e2ec58624f1cce5d (patch)
treeb55476e19c631607e821d6ea0fcc833b70100002
parent9c7dc624ac5b251101e5f5b351ec660f67b312af (diff)
downloadlibmicrohttpd-092b370587ff9dd258f52206e2ec58624f1cce5d.tar.gz
libmicrohttpd-092b370587ff9dd258f52206e2ec58624f1cce5d.zip
undo, duplicated functionality
-rw-r--r--ChangeLog5
-rw-r--r--doc/libmicrohttpd.texi8
-rw-r--r--src/include/microhttpd.h40
-rw-r--r--src/microhttpd/response.c10
4 files changed, 17 insertions, 46 deletions
diff --git a/ChangeLog b/ChangeLog
index e9e19071..6a057b73 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,3 @@
1Mon 22 Jul 2019 11:49:03 AM CEST
2 Introduce MHD_RO_FREE_FUNCTION. -NM/CG
3
4Tue Jul 16 19:56:14 CEST 2019 1Tue Jul 16 19:56:14 CEST 2019
5 Add MHD_OPTION_HTTPS_CERT_CALLBACK2 to allow OCSP stapling 2 Add MHD_OPTION_HTTPS_CERT_CALLBACK2 to allow OCSP stapling
6 and MHD_FEATURE_HTTPS_CERT_CALLBACK2 to check for. -TR 3 and MHD_FEATURE_HTTPS_CERT_CALLBACK2 to check for. -TR
@@ -105,7 +102,7 @@ Sun Apr 21 16:40:00 MSK 2019
105 102
106Fri Apr 19 23:00:00 MSK 2019 103Fri Apr 19 23:00:00 MSK 2019
107 Rewritten SHA-256 calculations from scratch to avoid changing LGPL version; 104 Rewritten SHA-256 calculations from scratch to avoid changing LGPL version;
108 Added usage of GCC/Clang built-ins for bytes swap to significantly improve 105 Added usage of GCC/Clang built-ins for bytes swap to significantly improve
109 speed of MD5 and SHA-256 calculation on platforms with known endianness. 106 speed of MD5 and SHA-256 calculation on platforms with known endianness.
110 Added test for SHA-256 calculations. -EG 107 Added test for SHA-256 calculations. -EG
111 108
diff --git a/doc/libmicrohttpd.texi b/doc/libmicrohttpd.texi
index 242e338b..6f34d799 100644
--- a/doc/libmicrohttpd.texi
+++ b/doc/libmicrohttpd.texi
@@ -1219,14 +1219,6 @@ Response-specific options. Passed in the varargs portion of
1219@item MHD_RO_END 1219@item MHD_RO_END
1220No more options / last option. This is used to terminate the VARARGs 1220No more options / last option. This is used to terminate the VARARGs
1221list. 1221list.
1222
1223@item MHD_RO_FREE_FUNCTION
1224Use a custom function for freeing the memory passed when using
1225@code{MHD_create_response_from_buffer} with
1226@code{MHD_RESPMEM_MUST_FREE}. This replaces the use of libc's
1227@code{free()} function to release the memory with an implementation
1228provided by the application. The next argument must be of type
1229@code{MHD_ContentReaderFreeCallback}.
1230@end table 1222@end table
1231@end deftp 1223@end deftp
1232 1224
diff --git a/src/include/microhttpd.h b/src/include/microhttpd.h
index 93382152..9d28cdb1 100644
--- a/src/include/microhttpd.h
+++ b/src/include/microhttpd.h
@@ -132,7 +132,7 @@ typedef intptr_t ssize_t;
132 * Current version of the library. 132 * Current version of the library.
133 * 0x01093001 = 1.9.30-1. 133 * 0x01093001 = 1.9.30-1.
134 */ 134 */
135#define MHD_VERSION 0x00096503 135#define MHD_VERSION 0x00096502
136 136
137/** 137/**
138 * MHD-internal return code for "YES". 138 * MHD-internal return code for "YES".
@@ -2256,12 +2256,10 @@ typedef ssize_t
2256 2256
2257 2257
2258/** 2258/**
2259 * This method is called by libmicrohttpd if we are done with a content 2259 * This method is called by libmicrohttpd if we
2260 * reader. It should be used to free resources associated with the content 2260 * are done with a content reader. It should
2261 * reader. 2261 * be used to free resources associated with the
2262 * 2262 * content reader.
2263 * It is also used as a va_arg in #MHD_set_response_options() in combination
2264 * with #MHD_RO_FREE_FUNCTION.
2265 * 2263 *
2266 * @param cls closure 2264 * @param cls closure
2267 * @ingroup response 2265 * @ingroup response
@@ -2680,7 +2678,7 @@ _MHD_EXTERN int
2680MHD_set_connection_value (struct MHD_Connection *connection, 2678MHD_set_connection_value (struct MHD_Connection *connection,
2681 enum MHD_ValueKind kind, 2679 enum MHD_ValueKind kind,
2682 const char *key, 2680 const char *key,
2683 const char *value); 2681 const char *value);
2684 2682
2685 2683
2686/** 2684/**
@@ -2710,11 +2708,11 @@ MHD_set_connection_value (struct MHD_Connection *connection,
2710 */ 2708 */
2711int 2709int
2712MHD_set_connection_value_n (struct MHD_Connection *connection, 2710MHD_set_connection_value_n (struct MHD_Connection *connection,
2713 enum MHD_ValueKind kind, 2711 enum MHD_ValueKind kind,
2714 const char *key, 2712 const char *key,
2715 size_t key_size, 2713 size_t key_size,
2716 const char *value, 2714 const char *value,
2717 size_t value_size); 2715 size_t value_size);
2718 2716
2719 2717
2720/** 2718/**
@@ -2808,7 +2806,7 @@ MHD_lookup_connection_value_n (struct MHD_Connection *connection,
2808_MHD_EXTERN int 2806_MHD_EXTERN int
2809MHD_queue_response (struct MHD_Connection *connection, 2807MHD_queue_response (struct MHD_Connection *connection,
2810 unsigned int status_code, 2808 unsigned int status_code,
2811 struct MHD_Response *response); 2809 struct MHD_Response *response);
2812 2810
2813 2811
2814/** 2812/**
@@ -2897,18 +2895,10 @@ enum MHD_ResponseFlags
2897 */ 2895 */
2898enum MHD_ResponseOptions 2896enum MHD_ResponseOptions
2899{ 2897{
2900 2898 /**
2901 /** 2899 * End of the list of options.
2902 * End of the list of options. 2900 */
2903 */ 2901 MHD_RO_END = 0
2904 MHD_RO_END = 0,
2905
2906 /**
2907 * Set a specific free() function
2908 * to free response buffer instead of libc void free(void * ptr)
2909 */
2910 MHD_RO_FREE_FUNCTION = 1
2911
2912}; 2902};
2913 2903
2914 2904
diff --git a/src/microhttpd/response.c b/src/microhttpd/response.c
index e9d5a4bf..035e3054 100644
--- a/src/microhttpd/response.c
+++ b/src/microhttpd/response.c
@@ -400,6 +400,7 @@ MHD_create_response_from_callback (uint64_t size,
400 return response; 400 return response;
401} 401}
402 402
403
403/** 404/**
404 * Set special flags and options for a response. 405 * Set special flags and options for a response.
405 * 406 *
@@ -424,15 +425,6 @@ MHD_set_response_options (struct MHD_Response *response,
424 { 425 {
425 switch (ro) 426 switch (ro)
426 { 427 {
427 case MHD_RO_FREE_FUNCTION:
428 va_start (ap, flags);
429 if (NULL != (response->crfc = va_arg (ap, MHD_ContentReaderFreeCallback))) {
430 ret = MHD_YES;
431 } else {
432 ret = MHD_NO;
433 }
434 va_end (ap);
435 break;
436 default: 428 default:
437 ret = MHD_NO; 429 ret = MHD_NO;
438 break; 430 break;