commit dec4c5771e73c117905010705aebc9971198d134
parent 18464c833e7cbd38acc5b3201cd7e08ffd3609ec
Author: Evgeny Grin (Karlson2k) <k2k@drgrin.dev>
Date: Fri, 30 Oct 2026 19:19:43 +0100
MHD_response_from_buffer(): clarified public doxy
Diffstat:
3 files changed, 15 insertions(+), 9 deletions(-)
diff --git a/doc/manual/responses.inc b/doc/manual/responses.inc
@@ -152,11 +152,13 @@ Create a response object with a callback that can be used to free resources afte
@item sc
HTTP status code for the response;
-@item size
-size of the data portion of the response;
+@item buffer_size
+size of the data portion of the response, must be zero if @var{buffer}
+is @code{NULL};
@item buffer
-the body to return, must contain at least @var{size} bytes of data;
+the body to return, must contain at least @var{buffer_size} bytes of data,
+can be @code{NULL} if @var{buffer_size} is zero;
the application must ensure that data in @var{buffer} remains valid
at least until the response was sent;
diff --git a/src/include/microhttpd2.h b/src/include/microhttpd2.h
@@ -6581,9 +6581,11 @@ MHD_response_from_callback_2cls (enum MHD_HTTP_StatusCode sc,
* header information.
*
* @param sc status code to use for the response;
- * #MHD_HTTP_STATUS_NO_CONTENT is only valid if @a size is 0;
- * @param buffer_size the size of the data portion of the response
- * @param buffer the @a size bytes containing the response's data portion,
+ * #MHD_HTTP_STATUS_NO_CONTENT is only valid if @a buffer_size is 0;
+ * @param buffer_size the size of the data portion of the response,
+ * must be zero if @a buffer is NULL
+ * @param buffer the @a buffer_size bytes containing the response's data
+ * portion, can be NULL if @a buffer_size is zero,
* needs to be valid while the response is used
* @param free_cb the callback to free any allocated data, called
* when response is being destroyed, can be NULL
diff --git a/src/include/microhttpd2_main.h.in b/src/include/microhttpd2_main.h.in
@@ -1519,9 +1519,11 @@ MHD_response_from_callback_2cls (enum MHD_HTTP_StatusCode sc,
* header information.
*
* @param sc status code to use for the response;
- * #MHD_HTTP_STATUS_NO_CONTENT is only valid if @a size is 0;
- * @param buffer_size the size of the data portion of the response
- * @param buffer the @a size bytes containing the response's data portion,
+ * #MHD_HTTP_STATUS_NO_CONTENT is only valid if @a buffer_size is 0;
+ * @param buffer_size the size of the data portion of the response,
+ * must be zero if @a buffer is NULL
+ * @param buffer the @a buffer_size bytes containing the response's data
+ * portion, can be NULL if @a buffer_size is zero,
* needs to be valid while the response is used
* @param free_cb the callback to free any allocated data, called
* when response is being destroyed, can be NULL