[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] branch master updated: Added new response create functio
From: |
gnunet |
Subject: |
[libmicrohttpd] branch master updated: Added new response create function. |
Date: |
Wed, 12 May 2021 19:55:04 +0200 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
The following commit(s) were added to refs/heads/master by this push:
new 8a9a64a7 Added new response create function.
8a9a64a7 is described below
commit 8a9a64a7034c5a8f55bccb9e1247ae26ee45669d
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Sat May 8 21:18:08 2021 +0300
Added new response create function.
Added MHD_create_response_from_buffer_with_free_callback_cls function
---
src/include/microhttpd.h | 24 +++++++++++++++++++++++-
src/microhttpd/response.c | 32 ++++++++++++++++++++++++++++++++
2 files changed, 55 insertions(+), 1 deletion(-)
diff --git a/src/include/microhttpd.h b/src/include/microhttpd.h
index 44156aab..4c9937bf 100644
--- a/src/include/microhttpd.h
+++ b/src/include/microhttpd.h
@@ -130,7 +130,7 @@ typedef intptr_t ssize_t;
* they are parsed as decimal numbers.
* Example: 0x01093001 = 1.9.30-1.
*/
-#define MHD_VERSION 0x00097301
+#define MHD_VERSION 0x00097302
/**
* Operational results from MHD calls.
@@ -3241,6 +3241,28 @@ MHD_create_response_from_buffer_with_free_callback
(size_t size,
crfc);
+/**
+ * Create a response object.
+ * The response object can be extended with header information and then be
+ * used any number of times.
+ *
+ * @param size size of the data portion of the response
+ * @param buffer size bytes containing the response's data portion
+ * @param crfc function to call to cleanup, if set to NULL then callback
+ * is not called
+ * @param crfc_cls an argument for @a crfc
+ * @return NULL on error (i.e. invalid arguments, out of memory)
+ * @note Available since #MHD_VERSION 0x00097302
+ * @ingroup response
+ */
+_MHD_EXTERN struct MHD_Response *
+MHD_create_response_from_buffer_with_free_callback_cls (size_t size,
+ void *buffer,
+
MHD_ContentReaderFreeCallback
+ crfc,
+ void *crfc_cls);
+
+
/**
* Create a response object. The response object can be extended with
* header information and then be used any number of times.
diff --git a/src/microhttpd/response.c b/src/microhttpd/response.c
index cc0cd38b..bf78d735 100644
--- a/src/microhttpd/response.c
+++ b/src/microhttpd/response.c
@@ -847,6 +847,38 @@ MHD_create_response_from_buffer_with_free_callback (size_t
size,
}
+/**
+ * Create a response object.
+ * The response object can be extended with header information and then be
+ * used any number of times.
+ *
+ * @param size size of the data portion of the response
+ * @param buffer size bytes containing the response's data portion
+ * @param crfc function to call to cleanup, if set to NULL then callback
+ * is not called
+ * @param crfc_cls an argument for @a crfc
+ * @return NULL on error (i.e. invalid arguments, out of memory)
+ * @note Available since #MHD_VERSION 0x00097302
+ * @ingroup response
+ */
+_MHD_EXTERN struct MHD_Response *
+MHD_create_response_from_buffer_with_free_callback_cls (size_t size,
+ void *buffer,
+
MHD_ContentReaderFreeCallback
+ crfc,
+ void *crfc_cls)
+{
+ struct MHD_Response *r;
+
+ r = MHD_create_response_from_buffer_with_free_callback (size,
+ buffer,
+ crfc);
+ if (NULL != r)
+ r->crc_cls = crfc_cls;
+ return r;
+}
+
+
/**
* Create a response object from an array of memory buffers.
* The response object can be extended with header information and then be used
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [libmicrohttpd] branch master updated: Added new response create function.,
gnunet <=