From a2f68ea8b627e2d009ac5624837b958694f335ff Mon Sep 17 00:00:00 2001 From: Matthias Wachs Date: Thu, 22 Mar 2012 11:05:22 +0000 Subject: [PATCH] --- src/include/gnunet_namestore_service.h | 2 +- src/namestore/gnunet-service-namestore.c | 3 ++- src/namestore/namestore.h | 1 + src/namestore/namestore_common.c | 15 +++++++++++++++ 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/include/gnunet_namestore_service.h b/src/include/gnunet_namestore_service.h index 1b5f89cb3..4f6f6a57d 100644 --- a/src/include/gnunet_namestore_service.h +++ b/src/include/gnunet_namestore_service.h @@ -254,7 +254,7 @@ GNUNET_NAMESTORE_record_create (struct GNUNET_NAMESTORE_Handle *h, * @param h handle to the namestore * @param pkey private key of the zone * @param name name that is being mapped (at most 255 characters long) - * @param rd record data + * @param rd record data, remove specific record, NULL to remove the name and all records * @param cont continuation to call when done * @param cont_cls closure for cont * @return handle to abort the request diff --git a/src/namestore/gnunet-service-namestore.c b/src/namestore/gnunet-service-namestore.c index 493d1f574..84ecb8ea1 100644 --- a/src/namestore/gnunet-service-namestore.c +++ b/src/namestore/gnunet-service-namestore.c @@ -1453,6 +1453,8 @@ void zone_iteration_proc (void *cls, GNUNET_HashCode long_hash; int authoritative = GNUNET_NO; + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "ZONE RESULT `%s'\n", name); + if ((zone_key == NULL) && (name == NULL)) { struct ZoneIterationResponseMessage zir_msg; @@ -1518,7 +1520,6 @@ void zone_iteration_proc (void *cls, authoritative = GNUNET_YES; } - zir_msg->gns_header.header.type = htons (GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_RESPONSE); zir_msg->gns_header.header.size = htons (msg_size); zir_msg->gns_header.r_id = htonl(zi->request_id); diff --git a/src/namestore/namestore.h b/src/namestore/namestore.h index a4fb56136..5a42c14d7 100644 --- a/src/namestore/namestore.h +++ b/src/namestore/namestore.h @@ -77,6 +77,7 @@ GNUNET_NAMESTORE_create_signature (const struct GNUNET_CRYPTO_RsaPrivateKey *key const struct GNUNET_NAMESTORE_RecordData *rd, unsigned int rd_count); + /** * Compares if two records are equal * diff --git a/src/namestore/namestore_common.c b/src/namestore/namestore_common.c index 831f52f83..023f20f43 100644 --- a/src/namestore/namestore_common.c +++ b/src/namestore/namestore_common.c @@ -277,6 +277,21 @@ GNUNET_NAMESTORE_create_signature (const struct GNUNET_CRYPTO_RsaPrivateKey *key return sig; } +/** + * Checks if a name is wellformed + * + * @param name the name to check + * @return GNUNET_OK on success, GNUNET_SYSERR on error + */ +int +GNUNET_NAMESTORE_check_name (const char * name) +{ + int res = GNUNET_OK; + if (strlen (name) > 63) + res = GNUNET_SYSERR; + return res; +} + /** * Convert the 'value' of a record to a string. -- 2.25.1