{
struct RecordLookupHandle* rlh;
rlh = (struct RecordLookupHandle*) cls;
+
+ GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
+ "GNS_PHASE_DELEGATE_NS-%llu: Resolution status: %d.\n",
+ rh->id, rh->status);
if (strcmp(rh->name, "") == 0)
{
* and exists
* or we are authority
**/
- if (((rh->status & RSL_RECORD_EXISTS) && (rh->status & !RSL_RECORD_EXPIRED))
+ if (((rh->status & RSL_RECORD_EXISTS) && (!(rh->status & RSL_RECORD_EXPIRED)))
|| !GNUNET_CRYPTO_short_hash_cmp(&rh->authority_chain_head->zone,
&local_zone))
{
if (name != NULL)
{
+ GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
+ "GNS_PHASE_DELEGATE_NS-%llu: Records with name %s exist.\n",
+ rh->id, name);
rh->status |= RSL_RECORD_EXISTS;
}
if (remaining_time.rel_value == 0)
{
+ GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
+ "GNS_PHASE_DELEGATE_NS-%llu: Record set %s expired.\n",
+ rh->id, name);
rh->status |= RSL_RECORD_EXPIRED;
}
*/
GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
"GNS_PHASE_DELEGATE_NS-%llu: Authority lookup and no PKEY...\n", rh->id);
- rh->proc(rh->proc_cls, rh, 0, NULL);
+ /**
+ * If we have found some records for the LAST label
+ * we return the results. Else null.
+ */
+ if (strcmp(rh->name, "") == 0)
+ {
+ /* simply promote back */
+ GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
+ "GNS_PHASE_DELEGATE_NS-%llu: Promoting %s back to name\n",
+ rh->id, rh->authority_name);
+ strcpy(rh->name, rh->authority_name);
+ rh->proc(rh->proc_cls, rh, rd_count, rd);
+ }
+ else
+ {
+ rh->proc(rh->proc_cls, rh, 0, NULL);
+ }
}
GNUNET_NAMESTORE_lookup_record(namestore_handle,
&rh->authority,
rh->authority_name,
- GNUNET_GNS_RECORD_PKEY,
+ GNUNET_GNS_RECORD_ANY,
&process_delegation_result_ns,
rh);
GNUNET_log (GNUNET_ERROR_TYPE_INFO, "done(ret=%d)!\n", ok);
}
+static void
+disco_dht(void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+{
+ GNUNET_DHT_disconnect(dht_handle);
+ dht_handle = NULL;
+}
+
/**
* Called when gns shorten finishes
*/
process_shorten_result(void* cls, const char* sname)
{
GNUNET_GNS_disconnect(gns_handle);
+ //GNUNET_SCHEDULER_add_now(disco_dht, NULL);
ok = 0;
if (sname == NULL)
static void
commence_testing (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- GNUNET_DHT_disconnect(dht_handle);
+ GNUNET_SCHEDULER_add_now(disco_dht, NULL);
+ //GNUNET_DHT_disconnect(dht_handle);
GNUNET_CRYPTO_rsa_key_free(our_key);
GNUNET_CRYPTO_rsa_key_free(bob_key);
if (ret != GNUNET_OK)
{
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
- "`test-gns-dht-delegated-lookup': Failed with error code %d\n", ret);
+ "`test-gns-pseu-shorten': Failed with error code %d\n", ret);
}
return ok;
}
{
int ret;
- GNUNET_log_setup ("test-gns-simple-lookup",
+ GNUNET_log_setup ("test-gns-pseu-shorten",
#if VERBOSE
"DEBUG",
#else