diff options
author | Christian Grothoff <christian@grothoff.org> | 2019-07-22 11:49:42 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2019-07-22 11:49:42 +0200 |
commit | 3d1b941137f9d8379e6e67d5abd57be5ae6ebe1a (patch) | |
tree | 43fa3d8dddba1f2bc160020e02f4b73f3521ca13 /src/include | |
parent | 3751044dc81a4b37de14b20dfc4cc7902fc36344 (diff) | |
download | libmicrohttpd-3d1b941137f9d8379e6e67d5abd57be5ae6ebe1a.tar.gz libmicrohttpd-3d1b941137f9d8379e6e67d5abd57be5ae6ebe1a.zip |
introducte MHD_RO_FREE_FUNCTION as proposed by Nicolas Mora on the list
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/microhttpd.h | 39 |
1 files changed, 28 insertions, 11 deletions
diff --git a/src/include/microhttpd.h b/src/include/microhttpd.h index 9d28cdb1..34f82154 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 0x00096502 | 135 | #define MHD_VERSION 0x00096503 |
136 | 136 | ||
137 | /** | 137 | /** |
138 | * MHD-internal return code for "YES". | 138 | * MHD-internal return code for "YES". |
@@ -2678,7 +2678,7 @@ _MHD_EXTERN int | |||
2678 | MHD_set_connection_value (struct MHD_Connection *connection, | 2678 | MHD_set_connection_value (struct MHD_Connection *connection, |
2679 | enum MHD_ValueKind kind, | 2679 | enum MHD_ValueKind kind, |
2680 | const char *key, | 2680 | const char *key, |
2681 | const char *value); | 2681 | const char *value); |
2682 | 2682 | ||
2683 | 2683 | ||
2684 | /** | 2684 | /** |
@@ -2708,11 +2708,11 @@ MHD_set_connection_value (struct MHD_Connection *connection, | |||
2708 | */ | 2708 | */ |
2709 | int | 2709 | int |
2710 | MHD_set_connection_value_n (struct MHD_Connection *connection, | 2710 | MHD_set_connection_value_n (struct MHD_Connection *connection, |
2711 | enum MHD_ValueKind kind, | 2711 | enum MHD_ValueKind kind, |
2712 | const char *key, | 2712 | const char *key, |
2713 | size_t key_size, | 2713 | size_t key_size, |
2714 | const char *value, | 2714 | const char *value, |
2715 | size_t value_size); | 2715 | size_t value_size); |
2716 | 2716 | ||
2717 | 2717 | ||
2718 | /** | 2718 | /** |
@@ -2806,7 +2806,7 @@ MHD_lookup_connection_value_n (struct MHD_Connection *connection, | |||
2806 | _MHD_EXTERN int | 2806 | _MHD_EXTERN int |
2807 | MHD_queue_response (struct MHD_Connection *connection, | 2807 | MHD_queue_response (struct MHD_Connection *connection, |
2808 | unsigned int status_code, | 2808 | unsigned int status_code, |
2809 | struct MHD_Response *response); | 2809 | struct MHD_Response *response); |
2810 | 2810 | ||
2811 | 2811 | ||
2812 | /** | 2812 | /** |
@@ -2895,14 +2895,31 @@ enum MHD_ResponseFlags | |||
2895 | */ | 2895 | */ |
2896 | enum MHD_ResponseOptions | 2896 | enum MHD_ResponseOptions |
2897 | { | 2897 | { |
2898 | /** | 2898 | |
2899 | * End of the list of options. | 2899 | /** |
2900 | */ | 2900 | * End of the list of options. |
2901 | MHD_RO_END = 0 | 2901 | */ |
2902 | MHD_RO_END = 0, | ||
2903 | |||
2904 | /** | ||
2905 | * Set a specific free() function | ||
2906 | * to free response buffer instead of libc void free(void * ptr) | ||
2907 | */ | ||
2908 | MHD_RO_FREE_FUNCTION = 1 | ||
2909 | |||
2902 | }; | 2910 | }; |
2903 | 2911 | ||
2904 | 2912 | ||
2905 | /** | 2913 | /** |
2914 | * This typedef is defined to be able to pass a function pointer | ||
2915 | * as a va_arg in #MHD_set_response_options() in combination | ||
2916 | * with #MHD_RO_FREE_FUNCTION. | ||
2917 | */ | ||
2918 | typedef void | ||
2919 | (*MHD_FreeFunction)(void *); | ||
2920 | |||
2921 | |||
2922 | /** | ||
2906 | * Set special flags and options for a response. | 2923 | * Set special flags and options for a response. |
2907 | * | 2924 | * |
2908 | * @param response the response to modify | 2925 | * @param response the response to modify |