From e2e045f3fef2231c435ae7dacbb5e947a0193a20 Mon Sep 17 00:00:00 2001 From: Martin Schanzenbach Date: Thu, 5 May 2016 09:13:47 +0000 Subject: - remove HAVE_REST, remove json reference from rest --- configure.ac | 2 -- src/Makefile.am | 6 ++++-- src/gns/Makefile.am | 4 +++- src/identity/Makefile.am | 4 +++- src/namestore/Makefile.am | 4 +++- src/rest/Makefile.am | 2 +- src/rest/rest.c | 7 +++---- 7 files changed, 17 insertions(+), 12 deletions(-) diff --git a/configure.ac b/configure.ac index e89f7befb..5b2f3fef2 100644 --- a/configure.ac +++ b/configure.ac @@ -970,8 +970,6 @@ AC_ARG_WITH(microhttpd, AM_CONDITIONAL(HAVE_MHD, test x$lmhd = x1) AC_DEFINE_UNQUOTED([HAVE_MHD], $lmhd, [We have libmicrohttpd]) -AM_CONDITIONAL(HAVE_REST, [test x$lmhd = x1 -a x$jansson = x1]) - AM_CONDITIONAL(HAVE_JSON, [test x$jansson = x1]) # restore LIBS diff --git a/src/Makefile.am b/src/Makefile.am index 946711797..5582c178b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -19,9 +19,11 @@ if HAVE_EXPERIMENTAL endif -if HAVE_REST +if HAVE_JSON +if HAVE_MHD PROVIDER_DIR = identity-provider endif +endif if HAVE_JSON JSON_DIR = json @@ -50,7 +52,7 @@ if HAVE_POSTGRESQL POSTGRES_DIR = pq postgres endif -if HAVE_REST +if HAVE_MHD REST_DIR = rest if HAVE_JSON JSONAPI_DIR = jsonapi diff --git a/src/gns/Makefile.am b/src/gns/Makefile.am index 5ac598735..04fe45224 100644 --- a/src/gns/Makefile.am +++ b/src/gns/Makefile.am @@ -92,9 +92,11 @@ plugin_LTLIBRARIES = \ libgnunet_plugin_gnsrecord_gns.la -if HAVE_REST +if HAVE_MHD +if HAVE_JSON plugin_LTLIBRARIES += libgnunet_plugin_rest_gns.la endif +endif libgnunet_plugin_gnsrecord_gns_la_SOURCES = \ plugin_gnsrecord_gns.c diff --git a/src/identity/Makefile.am b/src/identity/Makefile.am index f902f74fd..9b28ac093 100644 --- a/src/identity/Makefile.am +++ b/src/identity/Makefile.am @@ -39,11 +39,13 @@ bin_PROGRAMS = \ libexec_PROGRAMS = \ gnunet-service-identity -if HAVE_REST +if HAVE_MHD +if HAVE_JSON plugin_LTLIBRARIES = \ libgnunet_plugin_rest_identity.la \ libgnunet_plugin_gnsrecord_identity.la endif +endif gnunet_service_identity_SOURCES = \ diff --git a/src/namestore/Makefile.am b/src/namestore/Makefile.am index cf47e8507..5fddebfa8 100644 --- a/src/namestore/Makefile.am +++ b/src/namestore/Makefile.am @@ -71,9 +71,11 @@ check_PROGRAMS = \ $(TESTING_TESTS) endif -if HAVE_REST +if HAVE_MHD +if HAVE_JSON REST_PLUGIN=libgnunet_plugin_rest_namestore.la endif +endif if ENABLE_TEST_RUN AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH; diff --git a/src/rest/Makefile.am b/src/rest/Makefile.am index 9ab7c03e0..c0feb9122 100644 --- a/src/rest/Makefile.am +++ b/src/rest/Makefile.am @@ -38,7 +38,7 @@ libgnunetrest_la_SOURCES = \ rest.c libgnunetrest_la_LIBADD = \ $(top_builddir)/src/util/libgnunetutil.la $(XLIB) \ - $(GN_LIBINTL) -lmicrohttpd -ljansson + $(GN_LIBINTL) -lmicrohttpd libgnunetrest_la_LDFLAGS = \ $(GN_LIB_LDFLAGS) \ -version-info 0:0:0 diff --git a/src/rest/rest.c b/src/rest/rest.c index bf32c9849..b0d7e5ace 100644 --- a/src/rest/rest.c +++ b/src/rest/rest.c @@ -48,13 +48,13 @@ GNUNET_REST_namespace_match (const char *url, const char *namespace) } /** - * Create JSON API MHD response + * Create MHD response * - * @param data JSON result + * @param data result * @retun MHD response */ struct MHD_Response* -GNUNET_REST_create_json_response (const char *data) +GNUNET_REST_create_response (const char *data) { struct MHD_Response *resp; size_t len; @@ -69,7 +69,6 @@ GNUNET_REST_create_json_response (const char *data) resp = MHD_create_response_from_buffer (len, (void*)data, MHD_RESPMEM_MUST_COPY); - MHD_add_response_header (resp,MHD_HTTP_HEADER_CONTENT_TYPE,"application/json"); return resp; } -- cgit v1.2.3