[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnunet] 62/75: -fix json and namestore
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnunet] 62/75: -fix json and namestore |
Date: |
Thu, 09 Aug 2018 23:58:59 +0200 |
This is an automated email from the git hooks/post-receive script.
martin-schanzenbach pushed a commit to branch master
in repository gnunet.
commit 83095b7bbf49263d66ab1d89d0535e8fee2a9d01
Author: Phil <address@hidden>
AuthorDate: Wed Aug 1 03:26:50 2018 +0200
-fix json and namestore
---
src/json/json_generator.c | 2 +-
src/json/json_gnsrecord.c | 12 ++++++++++--
src/namestore/plugin_rest_namestore.c | 10 +---------
3 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/src/json/json_generator.c b/src/json/json_generator.c
index 7b24a3c12..d8c82bc86 100644
--- a/src/json/json_generator.c
+++ b/src/json/json_generator.c
@@ -166,7 +166,7 @@ GNUNET_JSON_from_rsa_signature (const struct
GNUNET_CRYPTO_RsaSignature *sig)
*/
json_t *
GNUNET_JSON_from_gns_record (const char* rname,
- const struct GNUNET_GNSRECORD_Data *rd)
+ const struct GNUNET_GNSRECORD_Data *rd)
{
struct GNUNET_TIME_Absolute expiration_time;
const char *expiration_time_str;
diff --git a/src/json/json_gnsrecord.c b/src/json/json_gnsrecord.c
index 48b78f38b..4f6d30748 100644
--- a/src/json/json_gnsrecord.c
+++ b/src/json/json_gnsrecord.c
@@ -23,7 +23,6 @@
*/
#include "platform.h"
#include "gnunet_util_lib.h"
-#include "gnunet_gnsrecord_lib.h"
#include "gnunet_json_lib.h"
#define GNUNET_JSON_GNSRECORD_VALUE "value"
@@ -111,7 +110,16 @@ parse_gnsrecordobject (void *cls,
}
else
{
- GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Value invalid for expiration time");
+ GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Expiration time invalid");
+ return GNUNET_SYSERR;
+ }
+ // check if flag is a valid enum value
+ if ((GNUNET_GNSRECORD_RF_NONE != flag)
+ && (GNUNET_GNSRECORD_RF_PRIVATE != flag)
+ && (GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION != flag)
+ && (GNUNET_GNSRECORD_RF_SHADOW_RECORD) != flag)
+ {
+ GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Flag invalid");
return GNUNET_SYSERR;
}
gnsrecord_object->flags = (enum GNUNET_GNSRECORD_Flags)flag;
diff --git a/src/namestore/plugin_rest_namestore.c
b/src/namestore/plugin_rest_namestore.c
index 6924c53a4..90928165e 100644
--- a/src/namestore/plugin_rest_namestore.c
+++ b/src/namestore/plugin_rest_namestore.c
@@ -32,6 +32,7 @@
#include "microhttpd.h"
#include <jansson.h>
+
#define GNUNET_REST_API_NS_NAMESTORE "/namestore"
#define GNUNET_REST_SUBSYSTEM_NAMESTORE "namestore"
@@ -40,8 +41,6 @@
#define GNUNET_REST_NAMESTORE_RD_COUNT 1
-//TODO define other variables
-
/**
* The configuration handle
*/
@@ -60,8 +59,6 @@ struct Plugin
const struct GNUNET_CONFIGURATION_Handle *cfg;
};
-//TODO add specific structs
-
/**
* The default namestore ego
*/
@@ -86,8 +83,6 @@ struct EgoEntry
struct RequestHandle
{
- //TODO add specific entries
-
/**
* Records to store
*/
@@ -180,8 +175,6 @@ struct RequestHandle
};
-
-//TODO add specific cleanup
/**
* Cleanup lookup handle
* @param handle Handle to clean up
@@ -638,7 +631,6 @@ options_cont (struct GNUNET_REST_RequestHandle *con_handle,
static void
init_cont (struct RequestHandle *handle)
{
- //TODO specify parameter of init_cont if necessary
struct GNUNET_REST_RequestHandlerError err;
static const struct GNUNET_REST_RequestHandler handlers[] = {
{MHD_HTTP_METHOD_GET, GNUNET_REST_API_NS_NAMESTORE, &namestore_get},
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnunet] 27/75: rps profiler: rewrite statistics handling, (continued)
- [GNUnet-SVN] [gnunet] 27/75: rps profiler: rewrite statistics handling, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 44/75: fix, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 43/75: seems like mysql is currently broken in Guix, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 49/75: update dockerfile, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 58/75: added name search, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 61/75: fix makefiles, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 53/75: -Merge branch 'master' of ssh://gnunet.org/gnunet into gsoc2018/rest_api, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 54/75: -Merge branch 'master' of ssh://gnunet.org/gnunet into gsoc2018/rest_api, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 75/75: Merge branch 'gsoc2018/rest_api', gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 64/75: fix lowercase identities, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 62/75: -fix json and namestore,
gnunet <=
- [GNUnet-SVN] [gnunet] 68/75: fix gns and identity test script, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 57/75: -fix identity file, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 72/75: Peerinfo Rest API finished, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 59/75: -wip namestore api, changed adding gnsrecord, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 71/75: -fix added timeout for gns Rest plugin, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 67/75: GNS REST API finished, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 50/75: -wip fix gns, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 70/75: Namestore Rest API finished, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 65/75: add peerinfo rest api, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 73/75: -Merge branch 'master' into gsoc2018/rest_api, gnunet, 2018/08/09