gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [gnunet] branch master updated: REST: ftbfs


From: gnunet
Subject: [GNUnet-SVN] [gnunet] branch master updated: REST: ftbfs
Date: Tue, 30 Apr 2019 17:57:37 +0200

This is an automated email from the git hooks/post-receive script.

martin-schanzenbach pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new c171a099e REST: ftbfs
c171a099e is described below

commit c171a099e07baa1afcaf8f6a5030a8b8be8886a5
Author: Schanzenbach, Martin <address@hidden>
AuthorDate: Tue Apr 30 17:57:20 2019 +0200

    REST: ftbfs
---
 src/gns/plugin_rest_gns.c | 25 ++++++-------------------
 1 file changed, 6 insertions(+), 19 deletions(-)

diff --git a/src/gns/plugin_rest_gns.c b/src/gns/plugin_rest_gns.c
index e41df4085..21638fdf6 100644
--- a/src/gns/plugin_rest_gns.c
+++ b/src/gns/plugin_rest_gns.c
@@ -100,7 +100,7 @@ struct RequestHandle
    * Rest connection
    */
   struct GNUNET_REST_RequestHandle *rest_handle;
-  
+
   /**
    * Desired timeout for the lookup (default is no timeout).
    */
@@ -172,7 +172,7 @@ cleanup_handle (void *cls)
     GNUNET_free (handle->name);
   if (NULL != handle->emsg)
     GNUNET_free (handle->emsg);
-  
+
   GNUNET_free (handle);
 }
 
@@ -222,8 +222,7 @@ handle_gns_response (void *cls,
 {
   struct RequestHandle *handle = cls;
   struct MHD_Response *resp;
-  json_t *result_array;
-  json_t *record_obj;
+  json_t *result_obj;
   char *result;
 
   handle->gns_lookup = NULL;
@@ -236,26 +235,14 @@ handle_gns_response (void *cls,
     return;
   }
 
-  result_array = json_array();
-  for (uint32_t i=0;i<rd_count;i++)
-  {
-    if ((rd[i].record_type != handle->record_type) &&
-        (GNUNET_GNSRECORD_TYPE_ANY != handle->record_type) )
-    {
-      continue;
-    }
-
-    record_obj = GNUNET_JSON_from_gns_record(NULL,&rd[i]);
-    json_array_append (result_array, record_obj);
-    json_decref (record_obj);
-  }
+  result_obj = GNUNET_JSON_from_gnsrecord (handle->name, rd, rd_count);
 
-  result = json_dumps(result_array, 0);
+  result = json_dumps(result_obj, 0);
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Result %s\n", result);
   resp = GNUNET_REST_create_response (result);
   handle->proc (handle->proc_cls, resp, MHD_HTTP_OK);
   GNUNET_free (result);
-  json_decref (result_array);
+  json_decref (result_obj);
   GNUNET_SCHEDULER_add_now(&cleanup_handle, handle);
 }
 

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

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