diff options
author | Martin Schanzenbach <mschanzenbach@posteo.de> | 2015-09-11 15:56:39 +0000 |
---|---|---|
committer | Martin Schanzenbach <mschanzenbach@posteo.de> | 2015-09-11 15:56:39 +0000 |
commit | c8aace43c41d50e03bd28b6e696b33c1da8b6c4c (patch) | |
tree | 375181e89bd4f099e0a2039ed0962bf7cfd48131 /src/rest/rest.c | |
parent | a12f20bd4c621a7b5e88ca52830ad1bb74a8e2d8 (diff) | |
download | gnunet-c8aace43c41d50e03bd28b6e696b33c1da8b6c4c.tar.gz gnunet-c8aace43c41d50e03bd28b6e696b33c1da8b6c4c.zip |
- move rest plugins into rest directory where they belong
Diffstat (limited to 'src/rest/rest.c')
-rw-r--r-- | src/rest/rest.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/rest/rest.c b/src/rest/rest.c index 3a27c6813..77427ef6c 100644 --- a/src/rest/rest.c +++ b/src/rest/rest.c | |||
@@ -403,12 +403,15 @@ GNUNET_REST_jsonapi_data_serialize (const struct JsonApiObject *resp, | |||
403 | json_t *root_json; | 403 | json_t *root_json; |
404 | json_t *res_arr; | 404 | json_t *res_arr; |
405 | 405 | ||
406 | if ( (NULL == resp) || | 406 | if ((NULL == resp)) |
407 | (0 == resp->res_count) ) | ||
408 | return GNUNET_SYSERR; | 407 | return GNUNET_SYSERR; |
409 | 408 | ||
410 | root_json = json_object (); | 409 | root_json = json_object (); |
411 | if (1 == resp->res_count) | 410 | if (0 == resp->res_count) |
411 | { | ||
412 | json_object_set (root_json, GNUNET_REST_JSONAPI_KEY_DATA, json_array()); | ||
413 | } | ||
414 | else if (1 == resp->res_count) | ||
412 | { | 415 | { |
413 | json_object_set (root_json, GNUNET_REST_JSONAPI_KEY_DATA, resp->res_list_head->res_obj); | 416 | json_object_set (root_json, GNUNET_REST_JSONAPI_KEY_DATA, resp->res_list_head->res_obj); |
414 | } | 417 | } |