[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r29585 - in gnunet/src: gns namestore
From: |
gnunet |
Subject: |
[GNUnet-SVN] r29585 - in gnunet/src: gns namestore |
Date: |
Thu, 26 Sep 2013 11:23:21 +0200 |
Author: grothoff
Date: 2013-09-26 11:23:21 +0200 (Thu, 26 Sep 2013)
New Revision: 29585
Modified:
gnunet/src/gns/gnunet-service-gns_resolver.c
gnunet/src/namestore/namestore_api.c
Log:
-more logging, minor code cleanup
Modified: gnunet/src/gns/gnunet-service-gns_resolver.c
===================================================================
--- gnunet/src/gns/gnunet-service-gns_resolver.c 2013-09-26 09:21:14 UTC
(rev 29584)
+++ gnunet/src/gns/gnunet-service-gns_resolver.c 2013-09-26 09:23:21 UTC
(rev 29585)
@@ -727,7 +727,10 @@
GNS_resolver_lookup_cancel (rh);
return;
}
-
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Received DNS response for `%s' with %u answers\n",
+ rh->ac_tail->label,
+ (unsigned int) p->num_answers);
if ( (p->num_answers > 0) &&
(GNUNET_DNSPARSER_TYPE_CNAME == p->answers[0].type) &&
(GNUNET_DNSPARSER_TYPE_CNAME != rh->record_type) )
@@ -881,6 +884,9 @@
ac = rh->ac_tail;
GNUNET_assert (NULL != ac);
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Starting DNS lookup for `%s'\n",
+ ac->label);
GNUNET_assert (GNUNET_NO == ac->gns_authority);
switch (((const struct sockaddr *)
&ac->authority_info.dns_authority.dns_ip)->sa_family)
{
@@ -1078,7 +1084,7 @@
/**
* Process a records that were decrypted from a block.
*
- * @param cls closure with the 'struct GNS_ResolverHandle'
+ * @param cls closure with the `struct GNS_ResolverHandle`
* @param rd_count number of entries in @a rd array
* @param rd array of records with data to store
*/
@@ -1107,7 +1113,12 @@
size_t off;
struct GNUNET_NAMESTORE_RecordData rd_new[rd_count];
unsigned int rd_off;
-
+
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Resolution succeeded for `%s' in zone %s, got %u records\n",
+ rh->ac_tail->label,
+ GNUNET_NAMESTORE_z2s (&rh->ac_tail->authority_info.gns_authority),
+ rd_count);
if (0 == rh->name_resolution_pos)
{
/* top-level match, are we done yet? */
@@ -1600,7 +1611,7 @@
* @param get_path_length number of entries in @a get_path
* @param put_path peers on the PUT path (or NULL if not recorded)
* [0] = origin, [length - 1] = datastore
- * @param put_path_length number of entries in @a get_path
+ * @param put_path_length number of entries in @a put_path
* @param type type of the result
* @param size number of bytes in data
* @param data pointer to the result data
@@ -1690,6 +1701,10 @@
(0 == GNUNET_TIME_absolute_get_remaining (GNUNET_TIME_absolute_ntoh
(block->expiration_time)).rel_value_us) ) )
{
/* Namestore knows nothing; try DHT lookup */
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Starting DHT lookup for `%s' in zone %s\n",
+ ac->label,
+ GNUNET_NAMESTORE_z2s (&ac->authority_info.gns_authority));
rh->get_handle = GNUNET_DHT_get_start (dht_handle,
GNUNET_BLOCK_TYPE_GNS_NAMERECORD,
&query,
@@ -1714,6 +1729,10 @@
(0 == GNUNET_TIME_absolute_get_remaining (GNUNET_TIME_absolute_ntoh
(block->expiration_time)).rel_value_us) )
{
/* DHT not permitted and no local result, fail */
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Resolution failed for `%s' in zone %s (DHT lookup not
permitted by configuration)\n",
+ ac->label,
+ GNUNET_NAMESTORE_z2s (&ac->authority_info.gns_authority));
rh->proc (rh->proc_cls, 0, NULL);
GNS_resolver_lookup_cancel (rh);
return;
@@ -1744,6 +1763,10 @@
struct AuthorityChain *ac = rh->ac_tail;
struct GNUNET_HashCode query;
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Starting GNS resolution for `%s' in zone %s\n",
+ ac->label,
+ GNUNET_NAMESTORE_z2s (&ac->authority_info.gns_authority));
GNUNET_NAMESTORE_query_from_public_key (&ac->authority_info.gns_authority,
ac->label,
&query);
@@ -1776,10 +1799,10 @@
GNS_resolver_lookup_cancel (rh);
return;
}
- if (GNUNET_YES == rh->ac_tail->gns_authority)
- recursive_gns_resolution_namestore (rh);
- else
- recursive_dns_resolution (rh);
+ if (GNUNET_YES == rh->ac_tail->gns_authority)
+ recursive_gns_resolution_namestore (rh);
+ else
+ recursive_dns_resolution (rh);
}
@@ -1897,6 +1920,9 @@
{
struct GNS_ResolverHandle *rh;
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Starting lookup for `%s'\n",
+ name);
rh = GNUNET_new (struct GNS_ResolverHandle);
GNUNET_CONTAINER_DLL_insert (rlh_head,
rlh_tail,
Modified: gnunet/src/namestore/namestore_api.c
===================================================================
--- gnunet/src/namestore/namestore_api.c 2013-09-26 09:21:14 UTC (rev
29584)
+++ gnunet/src/namestore/namestore_api.c 2013-09-26 09:23:21 UTC (rev
29585)
@@ -345,7 +345,8 @@
int res;
const char *emsg;
- LOG (GNUNET_ERROR_TYPE_DEBUG, "Received `%s'\n",
+ LOG (GNUNET_ERROR_TYPE_DEBUG,
+ "Received `%s'\n",
"RECORD_STORE_RESPONSE");
/* TODO: add actual error message from namestore to response... */
res = ntohl (msg->op_result);
@@ -1081,8 +1082,9 @@
GNUNET_break (rd_ser_len == GNUNET_NAMESTORE_records_serialize (rd_count,
rd, rd_ser_len, rd_ser));
LOG (GNUNET_ERROR_TYPE_DEBUG,
- "Sending `%s' message for name `%s' with size %u\n",
- "NAMESTORE_RECORD_STORE", label, msg_size);
+ "Sending `%s' message for name `%s' with size %u and %u records\n",
+ "NAMESTORE_RECORD_STORE", label, msg_size,
+ rd_count);
GNUNET_CONTAINER_DLL_insert_tail (h->pending_head, h->pending_tail, pe);
do_transmit(h);
return qe;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r29585 - in gnunet/src: gns namestore,
gnunet <=