reply_to_dns(rh, 0, NULL);
}
+
+
/**
* Function called when we get a result from the dht
* for our query
}
+
+/**
+ * Handle timeout for DHT requests
+ *
+ * @param cls the request handle as closure
+ * @param tc the task context
+ */
+static void
+dht_authority_lookup_timeout(void *cls,
+ const struct GNUNET_SCHEDULER_TaskContext *tc)
+{
+ struct GNUNET_GNS_ResolverHandle *rh = cls;
+
+ GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
+ "dht lookup for query %s (type=%d) timed out.\n",
+ rh->name, rh->query->type);
+
+ if (strcmp(rh->name, "") == 0)
+ {
+ /*
+ * promote authority back to name and try to resolve record
+ */
+ strcpy(rh->name, rh->authority_name);
+ resolve_record(rh);
+ }
+ else
+ {
+ GNUNET_DHT_get_stop (rh->get_handle);
+ reply_to_dns(rh, 0, NULL);
+ }
+}
+
+
/**
* Function called when we get a result from the dht
* for our query
GNUNET_CRYPTO_hash_xor(&name_hash, &rh->authority, &lookup_key);
rh->dht_timeout_task = GNUNET_SCHEDULER_add_delayed (DHT_LOOKUP_TIMEOUT,
- &dht_lookup_timeout,
+ &dht_authority_lookup_timeout,
rh);
xquery = htonl(GNUNET_GNS_RECORD_PKEY);