[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r20211 - gnunet/src/gns
From: |
gnunet |
Subject: |
[GNUnet-SVN] r20211 - gnunet/src/gns |
Date: |
Fri, 2 Mar 2012 23:10:38 +0100 |
Author: schanzen
Date: 2012-03-02 23:10:38 +0100 (Fri, 02 Mar 2012)
New Revision: 20211
Modified:
gnunet/src/gns/Makefile.am
gnunet/src/gns/gnunet-service-gns.c
gnunet/src/gns/test_gns_simple_lookup.c
Log:
-new test, fixes
Modified: gnunet/src/gns/Makefile.am
===================================================================
--- gnunet/src/gns/Makefile.am 2012-03-02 21:13:25 UTC (rev 20210)
+++ gnunet/src/gns/Makefile.am 2012-03-02 22:10:38 UTC (rev 20211)
@@ -28,7 +28,8 @@
test_gnunet_gns.sh
check_PROGRAMS = \
- test_gns_simple_lookup
+ test_gns_simple_lookup \
+ test_gns_simple_delegated_lookup
plugin_LTLIBRARIES = \
@@ -56,6 +57,18 @@
$(top_builddir)/src/namestore/libgnunetnamestore.la \
$(top_builddir)/src/testing/libgnunettesting.la
+test_gns_simple_delegated_lookup_SOURCES = \
+ test_gns_simple_delegated_lookup.c
+test_gns_simple_delegated_lookup_LDADD = \
+ $(top_builddir)/src/util/libgnunetutil.la \
+ $(top_builddir)/src/namestore/libgnunetnamestore.la \
+ $(top_builddir)/src/testing/libgnunettesting.la
+test_gns_simple_delegated_lookup_DEPENDENCIES = \
+ $(top_builddir)/src/util/libgnunetutil.la \
+ $(top_builddir)/src/namestore/libgnunetnamestore.la \
+ $(top_builddir)/src/testing/libgnunettesting.la
+
+
#gnunet_gns_lookup_SOURCES = \
# gnunet-gns-lookup.c
#gnunet_gns_lookup_LDADD = \
Modified: gnunet/src/gns/gnunet-service-gns.c
===================================================================
--- gnunet/src/gns/gnunet-service-gns.c 2012-03-02 21:13:25 UTC (rev 20210)
+++ gnunet/src/gns/gnunet-service-gns.c 2012-03-02 22:10:38 UTC (rev 20211)
@@ -606,30 +606,29 @@
if (rd[i].record_type != GNUNET_GNS_RECORD_PKEY)
continue;
- if ((GNUNET_TIME_absolute_get_remaining (rd[i].expiration)).rel_value
- == 0)
+ if ((GNUNET_TIME_absolute_get_remaining (rd[i].expiration)).rel_value
+ == 0)
+ {
+ GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "This pkey is expired.\n");
+ if (remaining_time.rel_value == 0)
{
- GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "This pkey is expired.\n");
- if (remaining_time.rel_value == 0)
- {
- GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
- "This dht entry is expired. Refreshing\n");
- resolve_authority_dht(rh);
- }
-
- continue;
+ GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
+ "This dht entry is expired. Refreshing\n");
+ resolve_authority_dht(rh);
}
- /**
- * Resolve rest of query with new authority
- */
- GNUNET_assert(rd[i].record_type == GNUNET_GNS_RECORD_PKEY);
- GNUNET_CRYPTO_hash(rd[i].data,
- sizeof(struct
GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded),
- &rh->authority);
- resolve_name(rh);
- return;
-
+ continue;
+ }
+
+ /**
+ * Resolve rest of query with new authority
+ */
+ GNUNET_assert(rd[i].record_type == GNUNET_GNS_RECORD_PKEY);
+ GNUNET_CRYPTO_hash(rd[i].data,
+ sizeof(struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded),
+ &rh->authority);
+ resolve_name(rh);
+ return;
}
/**
Modified: gnunet/src/gns/test_gns_simple_lookup.c
===================================================================
--- gnunet/src/gns/test_gns_simple_lookup.c 2012-03-02 21:13:25 UTC (rev
20210)
+++ gnunet/src/gns/test_gns_simple_lookup.c 2012-03-02 22:10:38 UTC (rev
20211)
@@ -75,7 +75,7 @@
/* Global return value (0 for success, anything else for failure) */
static int ok;
-static struct GNUNUET_NAMESTORE_Handle *namestore_handle;
+static struct GNUNET_NAMESTORE_Handle *namestore_handle;
const struct GNUNET_CONFIGURATION_Handle *cfg;
@@ -95,8 +95,8 @@
}
/**
- * Function scheduled to be run on the successful completion of this
- * testcase. Specifically, called when our get request completes.
+ * Function scheduled to be run on the successful start of services
+ * tries to look up the dns record for TEST_DOMAIN
*/
static void
finish_testing (void *cls, int32_t success, const char *emsg)
@@ -168,7 +168,9 @@
}
static void
-do_lookup(void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+do_lookup(void *cls, const struct GNUNET_PeerIdentity *id,
+ const struct GNUNET_CONFIGURATION_Handle *cfg,
+ struct GNUNET_TESTING_Daemon *d, const char *emsg)
{
struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded alice_pkey;
struct GNUNET_CRYPTO_RsaPrivateKey *alice_key;
@@ -189,7 +191,7 @@
"ZONEKEY",
&alice_keyfile))
{
- GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Failed to get alice's key from
cfg\n");
+ GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Failed to get key from cfg\n");
ok = -1;
return;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r20211 - gnunet/src/gns,
gnunet <=