From: Matthias Wachs Date: Thu, 1 Mar 2012 16:54:02 +0000 (+0000) Subject: - more changes X-Git-Tag: initial-import-from-subversion-38251~14513 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=3862df84d4e39ab20330223186544e2193cbeee6;p=oweals%2Fgnunet.git - more changes --- diff --git a/src/namestore/namestore_api.c b/src/namestore/namestore_api.c index 7a40b2091..a0fb794ad 100644 --- a/src/namestore/namestore_api.c +++ b/src/namestore/namestore_api.c @@ -1120,6 +1120,8 @@ GNUNET_NAMESTORE_record_remove (struct GNUNET_NAMESTORE_Handle *h, memcpy (name_tmp, name, name_len); memcpy (rd_tmp, rd_ser, rd_ser_len); + GNUNET_free (pkey_enc); + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending `%s' message for name `%s' with size %u\n", "NAMESTORE_RECORD_REMOVE", name, msg_size); GNUNET_CONTAINER_DLL_insert_tail (h->pending_head, h->pending_tail, pe); diff --git a/src/namestore/test_namestore_api_remove_not_existing_record.c b/src/namestore/test_namestore_api_remove_not_existing_record.c index b202c9357..8e71159fb 100644 --- a/src/namestore/test_namestore_api_remove_not_existing_record.c +++ b/src/namestore/test_namestore_api_remove_not_existing_record.c @@ -132,83 +132,21 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) stop_arm(); } -void name_lookup_proc (void *cls, - const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *zone_key, - struct GNUNET_TIME_Absolute expire, - const char *n, - unsigned int rd_count, - const struct GNUNET_NAMESTORE_RecordData *rd, - const struct GNUNET_CRYPTO_RsaSignature *signature) -{ - static int found = GNUNET_NO; - int failed = GNUNET_NO; - int c; - - if (n != NULL) - { - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Lookup for name `%s' returned %u records\n", n, rd_count); - if (0 != memcmp (zone_key, &pubkey, sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded))) - { - GNUNET_break (0); - failed = GNUNET_YES; - } - - if (0 != strcmp(n, s_name)) - { - GNUNET_break (0); - failed = GNUNET_YES; - } - - if (RECORDS-1 != rd_count) - { - GNUNET_break (0); - failed = GNUNET_YES; - } - - for (c = 0; c < rd_count; c++) - { - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Record [%u]: type: %u, size %u\n", c, rd[c].record_type, rd[c].data_size); - GNUNET_break (rd[c].expiration.abs_value == s_rd[c+1].expiration.abs_value); - GNUNET_break (rd[c].record_type == TEST_RECORD_TYPE); - GNUNET_break (rd[c].data_size == TEST_RECORD_DATALEN); - GNUNET_break (0 == memcmp (rd[c].data, s_rd[c+1].data, TEST_RECORD_DATALEN)); - } - - found = GNUNET_YES; - if (failed == GNUNET_NO) - res = 0; - else - res = 1; - } - else - { - if (found != GNUNET_YES) - { - GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to lookup records for name `%s'\n", s_name); - res = 1; - } - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Lookup done for name %s'\n", s_name); - } - GNUNET_SCHEDULER_add_now(&end, NULL); -} - void remove_cont (void *cls, int32_t success, const char *emsg) { char *name = cls; GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Remove record for `%s': %s `%s'\n", name, (success == GNUNET_YES) ? "SUCCESS" : "FAIL", emsg); - if (success == GNUNET_OK) + if (GNUNET_NO == success) { res = 0; - GNUNET_NAMESTORE_lookup_record (nsh, &s_zone, name, 0, &name_lookup_proc, name); } else { res = 1; - GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to put records for name `%s'\n", name); - GNUNET_SCHEDULER_add_now(&end, NULL); + GNUNET_break (0); } - + GNUNET_SCHEDULER_add_now(&end, NULL); } void