gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r35469 - gnunet/src/gns


From: gnunet
Subject: [GNUnet-SVN] r35469 - gnunet/src/gns
Date: Thu, 26 Mar 2015 19:30:11 +0100

Author: schanzen
Date: 2015-03-26 19:30:11 +0100 (Thu, 26 Mar 2015)
New Revision: 35469

Modified:
   gnunet/src/gns/plugin_rest_gns.c
Log:
-minor

Modified: gnunet/src/gns/plugin_rest_gns.c
===================================================================
--- gnunet/src/gns/plugin_rest_gns.c    2015-03-26 18:22:20 UTC (rev 35468)
+++ gnunet/src/gns/plugin_rest_gns.c    2015-03-26 18:30:11 UTC (rev 35469)
@@ -34,10 +34,11 @@
 #include <gnunet_rest_lib.h>
 #include <jansson.h>
 
-#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 @@
 {
   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 @@
 
   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; i<rd_count; i++)
   {
@@ -521,6 +522,8 @@
   struct GNUNET_HashCode key;
 
   handle->timeout = 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 @@
     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);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]