diff options
Diffstat (limited to 'src/microhttpd/response.c')
-rw-r--r-- | src/microhttpd/response.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/microhttpd/response.c b/src/microhttpd/response.c index b63db1e5..ef04f584 100644 --- a/src/microhttpd/response.c +++ b/src/microhttpd/response.c | |||
@@ -1379,6 +1379,38 @@ MHD_create_response_from_buffer (size_t size, | |||
1379 | 1379 | ||
1380 | 1380 | ||
1381 | /** | 1381 | /** |
1382 | * Create a response object with the content of provided statically allocated | ||
1383 | * buffer used as the response body. | ||
1384 | * | ||
1385 | * The buffer must be valid for the lifetime of the response. The easiest way | ||
1386 | * to achieve this is to use a statically allocated buffer. | ||
1387 | * | ||
1388 | * The response object can be extended with header information and then | ||
1389 | * be used any number of times. | ||
1390 | * | ||
1391 | * If response object is used to answer HEAD request then the body | ||
1392 | * of the response is not used, while all headers (including automatic | ||
1393 | * headers) are used. | ||
1394 | * | ||
1395 | * @param size the size of the data in @a buffer, can be zero | ||
1396 | * @param buffer the buffer with the data for the response body, can be NULL | ||
1397 | * if @a size is zero | ||
1398 | * @return NULL on error (i.e. invalid arguments, out of memory) | ||
1399 | * @note Available since #MHD_VERSION 0x00097506 | ||
1400 | * @ingroup response | ||
1401 | */ | ||
1402 | _MHD_EXTERN struct MHD_Response * | ||
1403 | MHD_create_response_from_buffer_static (size_t size, | ||
1404 | const void *buffer) | ||
1405 | { | ||
1406 | return MHD_create_response_from_buffer_with_free_callback_cls (size, | ||
1407 | buffer, | ||
1408 | NULL, | ||
1409 | NULL); | ||
1410 | } | ||
1411 | |||
1412 | |||
1413 | /** | ||
1382 | * Create a response object with the content of provided buffer used as | 1414 | * Create a response object with the content of provided buffer used as |
1383 | * the response body. | 1415 | * the response body. |
1384 | * | 1416 | * |