[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r20283 - gnunet/src/gns
From: |
gnunet |
Subject: |
[GNUnet-SVN] r20283 - gnunet/src/gns |
Date: |
Mon, 5 Mar 2012 17:50:24 +0100 |
Author: schanzen
Date: 2012-03-05 17:50:24 +0100 (Mon, 05 Mar 2012)
New Revision: 20283
Modified:
gnunet/src/gns/gnunet-service-gns.c
Log:
-fix
Modified: gnunet/src/gns/gnunet-service-gns.c
===================================================================
--- gnunet/src/gns/gnunet-service-gns.c 2012-03-05 15:38:49 UTC (rev 20282)
+++ gnunet/src/gns/gnunet-service-gns.c 2012-03-05 16:50:24 UTC (rev 20283)
@@ -314,6 +314,8 @@
reply_to_dns(rh, 0, NULL);
}
+
+
/**
* Function called when we get a result from the dht
* for our query
@@ -597,7 +599,40 @@
}
+
/**
+ * 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
*
@@ -752,7 +787,7 @@
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);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r20283 - gnunet/src/gns,
gnunet <=