gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [libmicrohttpd] branch master updated (acd39ed2 -> 2962b6e4


From: gnunet
Subject: [GNUnet-SVN] [libmicrohttpd] branch master updated (acd39ed2 -> 2962b6e4)
Date: Thu, 08 Nov 2018 14:53:48 +0100

This is an automated email from the git hooks/post-receive script.

grothoff pushed a change to branch master
in repository libmicrohttpd.

    from acd39ed2 releasing libmicrohttpd 0.9.60
     new 10bdf395 add MHD_create_response_from_buffer_with_free_callback
     new 2962b6e4 add MHD_create_response_from_buffer_with_free_callback

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 ChangeLog                 |  3 +++
 doc/libmicrohttpd.texi    | 18 ++++++++++++++++++
 src/include/microhttpd.h  | 18 ++++++++++++++++++
 src/microhttpd/response.c | 28 ++++++++++++++++++++++++++++
 4 files changed, 67 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 160bad46..5c1d625a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+Thu Nov  8 14:53:27 CET 2018
+       Add MHD_create_response_from_buffer_with_free_callback. -CG
+
 Tue Nov  6 19:43:47 CET 2018
        Upgrading to gettext 0.19.8.
        Releasing libmicrohttpd 0.9.60. -CG
diff --git a/doc/libmicrohttpd.texi b/doc/libmicrohttpd.texi
index 2ecb64e6..d87dac76 100644
--- a/doc/libmicrohttpd.texi
+++ b/doc/libmicrohttpd.texi
@@ -2020,6 +2020,24 @@ Return @code{NULL} on error (i.e. invalid arguments, out 
of memory).
 @end deftypefun
 
 
address@hidden {struct MHD_Response *} 
MHD_create_response_from_buffer_with_free_callback (size_t size, void *data,  
MHD_ContentReaderFreeCallback crfc)
+Create a response object.  The buffer at the end must be free'd
+by calling the @var{crfc} function.
+
address@hidden @var
address@hidden size
+size of the data portion of the response;
+
address@hidden buffer
+the data itself;
+
address@hidden crfc
+function to call at the end to free memory allocated at @var{buffer}.
address@hidden table
+
+Return @code{NULL} on error (i.e. invalid arguments, out of memory).
address@hidden deftypefun
+
 @deftypefun {struct MHD_Response *} MHD_create_response_from_data (size_t 
size, void *data, int must_free, int must_copy)
 Create a response object.  The response object can be extended with
 header information and then it can be used any number of times.
diff --git a/src/include/microhttpd.h b/src/include/microhttpd.h
index 8481ac5d..5d51e6d4 100644
--- a/src/include/microhttpd.h
+++ b/src/include/microhttpd.h
@@ -2763,6 +2763,24 @@ MHD_create_response_from_buffer (size_t size,
                                 enum MHD_ResponseMemoryMode mode);
 
 
+
+
+/**
+ * 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 free the @a buffer
+ * @return NULL on error (i.e. invalid arguments, out of memory)
+ * @ingroup response
+ */
+_MHD_EXTERN struct MHD_Response *
+MHD_create_response_from_buffer_with_free_callback (size_t size,
+                                                   void *buffer,
+                                                   
MHD_ContentReaderFreeCallback crfc);
+
+
 /**
  * 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 d7835c20..08b7805d 100644
--- a/src/microhttpd/response.c
+++ b/src/microhttpd/response.c
@@ -701,6 +701,34 @@ MHD_create_response_from_buffer (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 free the @a buffer
+ * @return NULL on error (i.e. invalid arguments, out of memory)
+ * @ingroup response
+ */
+_MHD_EXTERN struct MHD_Response *
+MHD_create_response_from_buffer_with_free_callback (size_t size,
+                                                   void *buffer,
+                                                   
MHD_ContentReaderFreeCallback crfc)
+{
+  struct MHD_Response *r;
+
+  r = MHD_create_response_from_data (size,
+                                    buffer,
+                                    GNUNET_YES,
+                                    GNUNET_NO);
+  if (NULL == r)
+    return r;
+  r->crfc = crfc;
+  return r;
+}
+
+
 #ifdef UPGRADE_SUPPORT
 /**
  * This connection-specific callback is provided by MHD to

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]