summaryrefslogtreecommitdiff
path: root/handler.h
diff options
context:
space:
mode:
authorꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2021-07-14 18:26:00 +0800
committerꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2021-07-14 18:26:00 +0800
commit3aab16c1b17edf43c74832a2fdbdf49980aa1c75 (patch)
tree58c93c600e25f521116f99b8bf455d2d49e9e1c8 /handler.h
parent1bd50fbe20f48e8eef4483a73f7467993d7870e2 (diff)
parent98e006f67c205a2674a1b35c3a215ba41ae1881b (diff)
Merge branch 'master' into sicepat
Diffstat (limited to 'handler.h')
-rw-r--r--handler.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/handler.h b/handler.h
index 7b2ac90..9c46975 100644
--- a/handler.h
+++ b/handler.h
@@ -1,3 +1,6 @@
+#ifdef DEBUG
+#include <stdio.h>
+#endif
#include <string.h>
#include <json.h>
#include "pikul.h"
@@ -8,6 +11,10 @@ void recurse(struct json_object *, const char *[], struct json_object **);
inline void handle_services(const char *contents, size_t num_bytes, const char *status_trail[],
const char *trail[], const char *attributes[], struct pikul_services **services)
{
+#ifdef DEBUG
+ ((char *)contents)[num_bytes] = '\0';
+ fprintf(stderr, "%s\n", contents);
+#endif
json_object *response = json_tokener_parse_ex(tokener, contents, num_bytes);
enum json_tokener_error error = json_tokener_get_error(tokener);
if (!response) {