aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gns/plugin_rest_gns.c21
-rw-r--r--src/rest/gnunet-rest-server.c2
2 files changed, 20 insertions, 3 deletions
diff --git a/src/gns/plugin_rest_gns.c b/src/gns/plugin_rest_gns.c
index d5d6788c8..2dc140b37 100644
--- a/src/gns/plugin_rest_gns.c
+++ b/src/gns/plugin_rest_gns.c
@@ -220,6 +220,7 @@ process_lookup_result (void *cls, uint32_t rd_count,
220 const char *typename; 220 const char *typename;
221 char *string_val; 221 char *string_val;
222 char *result; 222 char *result;
223 const char *exp_str;
223 json_t *result_root; 224 json_t *result_root;
224 json_t *result_name; 225 json_t *result_name;
225 json_t *result_array; 226 json_t *result_array;
@@ -254,6 +255,24 @@ process_lookup_result (void *cls, uint32_t rd_count,
254 record_obj = json_object(); 255 record_obj = json_object();
255 json_object_set_new (record_obj, "type", json_string (typename)); 256 json_object_set_new (record_obj, "type", json_string (typename));
256 json_object_set_new (record_obj, "value", json_string (string_val)); 257 json_object_set_new (record_obj, "value", json_string (string_val));
258
259 if (GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION & rd[i].flags)
260 {
261 struct GNUNET_TIME_Relative time_rel;
262 time_rel.rel_value_us = rd[i].expiration_time;
263 exp_str = GNUNET_STRINGS_relative_time_to_string (time_rel, 1);
264 }
265 else
266 {
267 struct GNUNET_TIME_Absolute time_abs;
268 time_abs.abs_value_us = rd[i].expiration_time;
269 exp_str = GNUNET_STRINGS_absolute_time_to_string (time_abs);
270 }
271 json_object_set_new (record_obj, "expiration_time", json_string (exp_str));
272
273 json_object_set_new (record_obj, "expired",
274 json_boolean (GNUNET_YES == GNUNET_GNSRECORD_is_expired (&(rd[i]))));
275
257 json_array_append (result_array, record_obj); 276 json_array_append (result_array, record_obj);
258 json_decref (record_obj); 277 json_decref (record_obj);
259 } 278 }
@@ -262,7 +281,7 @@ process_lookup_result (void *cls, uint32_t rd_count,
262 json_object_set (result_root, "query_result", result_array); 281 json_object_set (result_root, "query_result", result_array);
263 json_decref (result_array); 282 json_decref (result_array);
264 result = json_dumps (result_root, JSON_COMPACT); 283 result = json_dumps (result_root, JSON_COMPACT);
265 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Result %s\n", result); 284 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Result %s\n", result);
266 json_decref (result_root); 285 json_decref (result_root);
267 handle->proc (handle->proc_cls, result, strlen (result), GNUNET_OK); 286 handle->proc (handle->proc_cls, result, strlen (result), GNUNET_OK);
268 GNUNET_free (result); 287 GNUNET_free (result);
diff --git a/src/rest/gnunet-rest-server.c b/src/rest/gnunet-rest-server.c
index 26ca8f5cd..01913ef53 100644
--- a/src/rest/gnunet-rest-server.c
+++ b/src/rest/gnunet-rest-server.c
@@ -256,8 +256,6 @@ create_response (void *cls,
256 } 256 }
257 return MHD_YES; 257 return MHD_YES;
258 } 258 }
259 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
260 "Size %d\n", *upload_data_size);
261 if (GN_REST_STATE_INIT == con_handle->state) 259 if (GN_REST_STATE_INIT == con_handle->state)
262 { 260 {
263 if (0 != *upload_data_size) 261 if (0 != *upload_data_size)