From 7ffa2920a4a210c1ef53be37396c116207cec9a1 Mon Sep 17 00:00:00 2001 From: Olof hagsand Date: Sat, 6 Jun 2020 12:34:48 +0200 Subject: [PATCH] * Removed printfs in xpath-equal code --- CHANGELOG.md | 11 +++++++++++ lib/src/clixon_xpath.c | 14 +++++++------- util/Makefile.in | 4 ++-- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d0f3a50c..003669a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,17 @@ ## 4.6.0 Expected: July 2020 +### Major New features + +* Embedding restconf into the existing [libevhtp](https://github.com/criticalstack/libevhtp) embedded web server. Experimental. + * The existing FCGI restconf solution will continue to be supported for NGINX and other reverese proxies with an fast CGI API. + * The restconf code has been refactored to support both modes. Hopefully, it should be straightforward to add another embedded server, such as GNU microhttpd. + * The new restconf module is selected using a compile-time autotools configure as follows: + * `--with-restconf=fcgi FCGI interface for stand-alone web rev-proxy eg nginx (default)` + * `--with-restconf=evhtp Integrate restconf with libevhtp server` + * `--without-restconf Disable restconf altogether` + + ### C-API changes on existing features (For developers) * Due to name collision with libevent, all clixon event functions prepended with `clixon_`. You need to rename your event functions as follows: diff --git a/lib/src/clixon_xpath.c b/lib/src/clixon_xpath.c index a7ff7116..8a6f7076 100644 --- a/lib/src/clixon_xpath.c +++ b/lib/src/clixon_xpath.c @@ -353,7 +353,7 @@ xpath_tree_eq(xpath_tree *xt1, /* pattern */ (xt2->xs_type == XP_PRIME_NR || xt2->xs_type == XP_PRIME_STR)) #endif ){ - fprintf(stderr, "%s type %s vs %s\n", __FUNCTION__, + clicon_debug(2, "%s type %s vs %s\n", __FUNCTION__, xpath_tree_int2str(xt1->xs_type), xpath_tree_int2str(xt2->xs_type)); goto neq; @@ -365,19 +365,19 @@ xpath_tree_eq(xpath_tree *xt1, /* pattern */ goto eq; } if (xt1->xs_int != xt2->xs_int){ - fprintf(stderr, "%s int\n", __FUNCTION__); + clicon_debug(2, "%s int\n", __FUNCTION__); goto neq; } if (xt1->xs_double != xt2->xs_double){ - fprintf(stderr, "%s double\n", __FUNCTION__); + clicon_debug(2, "%s double\n", __FUNCTION__); goto neq; } if (clicon_strcmp(xt1->xs_s0, xt2->xs_s0)){ - fprintf(stderr, "%s s0\n", __FUNCTION__); + clicon_debug(2, "%s s0\n", __FUNCTION__); goto neq; } if (clicon_strcmp(xt1->xs_s1, xt2->xs_s1)){ - fprintf(stderr, "%s s1\n", __FUNCTION__); + clicon_debug(2, "%s s1\n", __FUNCTION__); goto neq; } xc1 = xt1->xs_c0; @@ -386,7 +386,7 @@ xpath_tree_eq(xpath_tree *xt1, /* pattern */ ; else{ if (xc1 == NULL || xc2 == NULL){ - fprintf(stderr, "%s NULL\n", __FUNCTION__); + clicon_debug(2, "%s NULL\n", __FUNCTION__); goto neq; } if ((ret = xpath_tree_eq(xc1, xc2, vec, len)) < 0) @@ -400,7 +400,7 @@ xpath_tree_eq(xpath_tree *xt1, /* pattern */ ; else{ if (xc1 == NULL || xc2 == NULL){ - fprintf(stderr, "%s NULL\n", __FUNCTION__); + clicon_debug(2, "%s NULL\n", __FUNCTION__); goto neq; } if ((ret = xpath_tree_eq(xc1, xc2, vec, len)) < 0) diff --git a/util/Makefile.in b/util/Makefile.in index c6e07687..f9a9da5f 100644 --- a/util/Makefile.in +++ b/util/Makefile.in @@ -78,7 +78,7 @@ APPSRC += clixon_util_xpath.c APPSRC += clixon_util_path.c APPSRC += clixon_util_datastore.c APPSRC += clixon_util_regexp.c -ifeq ($(with_restconf),yes) +ifdef with_restconf APPSRC += clixon_util_stream.c # Needs curl endif APPSRC += clixon_util_socket.c @@ -121,7 +121,7 @@ clixon_util_xml_mod: clixon_util_xml_mod.c $(LIBDEPS) clixon_util_regexp: clixon_util_regexp.c $(LIBDEPS) $(CC) $(INCLUDES) -I /usr/include/libxml2 $(CPPFLAGS) @CFLAGS@ $(LDFLAGS) $^ $(LIBS) -o $@ -ifeq ($(with_restconf),yes) +ifdef with_restconf clixon_util_stream: clixon_util_stream.c $(LIBDEPS) $(CC) $(INCLUDES) $(CPPFLAGS) @CFLAGS@ $(LDFLAGS) $^ $(LIBS) -lcurl -o $@ endif