gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r29514 - gnunet/src/namestore


From: gnunet
Subject: [GNUnet-SVN] r29514 - gnunet/src/namestore
Date: Tue, 24 Sep 2013 10:33:53 +0200

Author: grothoff
Date: 2013-09-24 10:33:53 +0200 (Tue, 24 Sep 2013)
New Revision: 29514

Modified:
   gnunet/src/namestore/namestore.h
   gnunet/src/namestore/namestore_api.c
Log:
handle empty result set gracefully

Modified: gnunet/src/namestore/namestore.h
===================================================================
--- gnunet/src/namestore/namestore.h    2013-09-24 08:28:19 UTC (rev 29513)
+++ gnunet/src/namestore/namestore.h    2013-09-24 08:33:53 UTC (rev 29514)
@@ -76,7 +76,7 @@
 struct LookupBlockResponseMessage
 {
   /**
-   * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_LOOKUP_BLOCK_RESPONSE
+   * Type will be #GNUNET_MESSAGE_TYPE_NAMESTORE_LOOKUP_BLOCK_RESPONSE
    */
   struct GNUNET_NAMESTORE_Header gns_header;
 

Modified: gnunet/src/namestore/namestore_api.c
===================================================================
--- gnunet/src/namestore/namestore_api.c        2013-09-24 08:28:19 UTC (rev 
29513)
+++ gnunet/src/namestore/namestore_api.c        2013-09-24 08:33:53 UTC (rev 
29514)
@@ -253,12 +253,12 @@
 
 
 /**
- * Handle an incoming message of type 
'GNUNET_MESSAGE_TYPE_NAMESTORE_LOOKUP_BLOCK_RESPONSE'
+ * Handle an incoming message of type 
#GNUNET_MESSAGE_TYPE_NAMESTORE_LOOKUP_BLOCK_RESPONSE.
  *
  * @param qe the respective entry in the message queue
  * @param msg the message we received
  * @param size the message size
- * @return GNUNET_OK on success, GNUNET_SYSERR on error and we did NOT notify 
the client
+ * @return #GNUNET_OK on success, #GNUNET_SYSERR on error and we did NOT 
notify the client
  */
 static int
 handle_lookup_block_response (struct GNUNET_NAMESTORE_QueueEntry *qe,
@@ -271,6 +271,14 @@
   LOG (GNUNET_ERROR_TYPE_DEBUG,
        "Received `%s'\n", 
        "LOOKUP_BLOCK_RESPONSE");
+  if (0 == GNUNET_TIME_absolute_ntoh (msg->expire).abs_value_us)
+  {
+    /* no match found */
+    if (NULL != qe->block_proc)
+      qe->block_proc (qe->block_proc_cls, NULL);
+    return GNUNET_OK;
+  }
+
   block = (struct GNUNET_NAMESTORE_Block *) buf;
   block->signature = msg->signature;
   block->derived_key = msg->derived_key;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]