From 569c29270cb9fdc4c236795ecef2d895a3ecbd76 Mon Sep 17 00:00:00 2001 From: Martin Schanzenbach Date: Thu, 26 Mar 2015 18:30:11 +0000 Subject: [PATCH] -minor --- src/gns/plugin_rest_gns.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/gns/plugin_rest_gns.c b/src/gns/plugin_rest_gns.c index 1859a76e1..6922c7d79 100644 --- a/src/gns/plugin_rest_gns.c +++ b/src/gns/plugin_rest_gns.c @@ -34,10 +34,11 @@ #include #include -#define API_NAMESPACE "/gns" +#define API_NAMESPACE "/resolver" +#define GNUNET_REST_JSONAPI_GNS_RECORD_TYPE "record_type" -#define GNUNET_REST_JSONAPI_GNS_RECORD_TYPE "type" +#define GNUNET_REST_JSONAPI_GNS_TYPEINFO "gns_name" #define GNUNET_REST_JSONAPI_GNS_RECORD "records" @@ -215,7 +216,7 @@ do_error (void *cls, { struct LookupHandle *handle = cls; struct MHD_Response *resp = GNUNET_REST_create_json_response (NULL); - handle->proc (handle->proc_cls, resp, GNUNET_SYSERR); + handle->proc (handle->proc_cls, resp, MHD_HTTP_BAD_REQUEST); cleanup_handle (handle); } @@ -291,7 +292,7 @@ process_lookup_result (void *cls, uint32_t rd_count, result_array = json_array(); json_object = GNUNET_REST_jsonapi_object_new (); - json_resource = GNUNET_REST_jsonapi_resource_new (GNUNET_REST_JSONAPI_GNS_RECORD, handle->name); + json_resource = GNUNET_REST_jsonapi_resource_new (GNUNET_REST_JSONAPI_GNS_TYPEINFO, handle->name); handle->lookup_request = NULL; for (i=0; itimeout = GNUNET_TIME_UNIT_FOREVER_REL; + handle->proc_cls = proc_cls; + handle->proc = proc; //parse name and type from url if (GNUNET_OK != parse_url (conndata_handle->url, handle)) { @@ -528,8 +531,6 @@ rest_gns_process_request(struct RestConnectionDataHandle *conndata_handle, GNUNET_SCHEDULER_add_now (&do_error, handle); return; } - handle->proc_cls = proc_cls; - handle->proc = proc; GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Connecting...\n"); handle->gns = GNUNET_GNS_connect (cfg); -- 2.25.1