[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r20533 - gnunet/src/gns
From: |
gnunet |
Subject: |
[GNUnet-SVN] r20533 - gnunet/src/gns |
Date: |
Thu, 15 Mar 2012 15:05:23 +0100 |
Author: schanzen
Date: 2012-03-15 15:05:23 +0100 (Thu, 15 Mar 2012)
New Revision: 20533
Modified:
gnunet/src/gns/gnunet-service-gns_resolver.c
gnunet/src/gns/plugin_block_gns.c
Log:
-fixes, block plugin change
Modified: gnunet/src/gns/gnunet-service-gns_resolver.c
===================================================================
--- gnunet/src/gns/gnunet-service-gns_resolver.c 2012-03-15 13:54:04 UTC
(rev 20532)
+++ gnunet/src/gns/gnunet-service-gns_resolver.c 2012-03-15 14:05:23 UTC
(rev 20533)
@@ -602,8 +602,8 @@
* should never get here unless false dht key/put
* block plugin should handle this
**/
- GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "DHT authority lookup error!\n");
- GNUNET_break(0);
+ GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "DHT authority lookup found no
match!\n");
+ rh->proc(rh->proc_cls, rh, 0, NULL);
}
Modified: gnunet/src/gns/plugin_block_gns.c
===================================================================
--- gnunet/src/gns/plugin_block_gns.c 2012-03-15 13:54:04 UTC (rev 20532)
+++ gnunet/src/gns/plugin_block_gns.c 2012-03-15 14:05:23 UTC (rev 20533)
@@ -77,9 +77,20 @@
if (type != GNUNET_BLOCK_TYPE_GNS_NAMERECORD)
return GNUNET_BLOCK_EVALUATION_TYPE_NOT_SUPPORTED;
- if (reply_block_size == 0)
- return GNUNET_BLOCK_EVALUATION_REQUEST_VALID;
-
+ if (reply_block == NULL)
+ {
+ /**
+ * check if request is valid
+ * FIXME we could check for the record types here
+ **/
+ if (xquery_size < sizeof(uint32_t))
+ return GNUNET_BLOCK_EVALUATION_REQUEST_INVALID;
+ else
+ return GNUNET_BLOCK_EVALUATION_REQUEST_VALID;
+ }
+
+ /* this is a reply */
+
nrb = (struct GNSNameRecordBlock *)reply_block;
name = (char*)&nrb[1];
GNUNET_CRYPTO_hash(&nrb->public_key,
@@ -101,7 +112,7 @@
/* Check query key against public key */
if (0 != GNUNET_CRYPTO_hash_cmp(query, &query_key))
- return GNUNET_BLOCK_EVALUATION_REQUEST_VALID;
+ return GNUNET_BLOCK_EVALUATION_RESULT_INVALID;
record_match = 0;
rd_count = ntohl(nrb->rd_count);
@@ -121,7 +132,7 @@
{
GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
"Data invalid (%d bytes, %d records)\n", rd_len, rd_count);
- return GNUNET_BLOCK_EVALUATION_REQUEST_INVALID;
+ return GNUNET_BLOCK_EVALUATION_RESULT_INVALID;
}
if (xquery_size < sizeof(uint32_t))
@@ -156,19 +167,10 @@
&nrb->signature))
{
GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Signature invalid\n");
- return GNUNET_BLOCK_EVALUATION_REQUEST_INVALID;
+ return GNUNET_BLOCK_EVALUATION_RESULT_INVALID;
}
}
- if ((record_xquery != 0) && (record_match == 0))
- {
- GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
- "No record matches query!\n");
- return GNUNET_BLOCK_EVALUATION_REQUEST_VALID;
- }
-
- GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Records match\n");
-
if (NULL != bf)
{
GNUNET_CRYPTO_hash(reply_block, reply_block_size, &chash);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r20533 - gnunet/src/gns,
gnunet <=