commit 1e314fd50a9ba0357d3a722ebcc7c125a37c06b1
parent 7a6a9d14a4aa0c745e2804a9fe4e876bbb624217
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date: Sun, 12 Sep 2021 19:21:49 +0300
postprocessor: use NULL for 'data' for callback if no value is present
Diffstat:
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/include/microhttpd.h b/src/include/microhttpd.h
@@ -96,7 +96,7 @@ extern "C"
* they are parsed as decimal numbers.
* Example: 0x01093001 = 1.9.30-1.
*/
-#define MHD_VERSION 0x00097312
+#define MHD_VERSION 0x00097313
/* If generic headers don't work on your platform, include headers
which define 'va_list', 'size_t', 'ssize_t', 'intptr_t',
@@ -2448,7 +2448,7 @@ typedef void
* @param content_type mime-type of the data, NULL if not known
* @param transfer_encoding encoding of the data, NULL if not known
* @param data pointer to @a size bytes of data at the
- * specified offset
+ * specified offset, NULL if no value is present
* @param off offset of data in the overall value
* @param size number of bytes in @a data available
* @return #MHD_YES to continue iterating,
diff --git a/src/microhttpd/postprocessor.c b/src/microhttpd/postprocessor.c
@@ -453,7 +453,8 @@ process_value (struct MHD_PostProcessor *pp,
NULL,
NULL,
NULL,
- xbuf,
+ ((0 != xoff) || (0 != pp->value_offset) ||
+ (NULL != value_end)) ? xbuf : NULL,
pp->value_offset,
xoff))
{