diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/include/microhttpd.h | 18 | ||||
-rw-r--r-- | src/microhttpd/response.c | 28 |
2 files changed, 46 insertions, 0 deletions
diff --git a/src/include/microhttpd.h b/src/include/microhttpd.h index 70ecd6e9..f8ec0122 100644 --- a/src/include/microhttpd.h +++ b/src/include/microhttpd.h | |||
@@ -2763,6 +2763,24 @@ MHD_create_response_from_buffer (size_t size, | |||
2763 | enum MHD_ResponseMemoryMode mode); | 2763 | enum MHD_ResponseMemoryMode mode); |
2764 | 2764 | ||
2765 | 2765 | ||
2766 | |||
2767 | |||
2768 | /** | ||
2769 | * Create a response object. The response object can be extended with | ||
2770 | * header information and then be used any number of times. | ||
2771 | * | ||
2772 | * @param size size of the data portion of the response | ||
2773 | * @param buffer size bytes containing the response's data portion | ||
2774 | * @param crfc function to call to free the @a buffer | ||
2775 | * @return NULL on error (i.e. invalid arguments, out of memory) | ||
2776 | * @ingroup response | ||
2777 | */ | ||
2778 | _MHD_EXTERN struct MHD_Response * | ||
2779 | MHD_create_response_from_buffer_with_free_callback (size_t size, | ||
2780 | void *buffer, | ||
2781 | MHD_ContentReaderFreeCallback crfc); | ||
2782 | |||
2783 | |||
2766 | /** | 2784 | /** |
2767 | * Create a response object. The response object can be extended with | 2785 | * Create a response object. The response object can be extended with |
2768 | * header information and then be used any number of times. | 2786 | * 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, | |||
701 | } | 701 | } |
702 | 702 | ||
703 | 703 | ||
704 | /** | ||
705 | * Create a response object. The response object can be extended with | ||
706 | * header information and then be used any number of times. | ||
707 | * | ||
708 | * @param size size of the data portion of the response | ||
709 | * @param buffer size bytes containing the response's data portion | ||
710 | * @param crfc function to call to free the @a buffer | ||
711 | * @return NULL on error (i.e. invalid arguments, out of memory) | ||
712 | * @ingroup response | ||
713 | */ | ||
714 | _MHD_EXTERN struct MHD_Response * | ||
715 | MHD_create_response_from_buffer_with_free_callback (size_t size, | ||
716 | void *buffer, | ||
717 | MHD_ContentReaderFreeCallback crfc) | ||
718 | { | ||
719 | struct MHD_Response *r; | ||
720 | |||
721 | r = MHD_create_response_from_data (size, | ||
722 | buffer, | ||
723 | GNUNET_YES, | ||
724 | GNUNET_NO); | ||
725 | if (NULL == r) | ||
726 | return r; | ||
727 | r->crfc = crfc; | ||
728 | return r; | ||
729 | } | ||
730 | |||
731 | |||
704 | #ifdef UPGRADE_SUPPORT | 732 | #ifdef UPGRADE_SUPPORT |
705 | /** | 733 | /** |
706 | * This connection-specific callback is provided by MHD to | 734 | * This connection-specific callback is provided by MHD to |