diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-09-24 08:33:53 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-09-24 08:33:53 +0000 |
commit | d8b4c75703a974e5f7bdf39f77fc91d1f70d43bb (patch) | |
tree | cdc91ef8183bbc42014c89129cb6d7ce48bb909a /src/namestore | |
parent | 6c33a3bbe11a98b306b42854812d8af6662b892e (diff) | |
download | gnunet-d8b4c75703a974e5f7bdf39f77fc91d1f70d43bb.tar.gz gnunet-d8b4c75703a974e5f7bdf39f77fc91d1f70d43bb.zip |
handle empty result set gracefully
Diffstat (limited to 'src/namestore')
-rw-r--r-- | src/namestore/namestore.h | 2 | ||||
-rw-r--r-- | src/namestore/namestore_api.c | 12 |
2 files changed, 11 insertions, 3 deletions
diff --git a/src/namestore/namestore.h b/src/namestore/namestore.h index 61691b95e..6d22b5d99 100644 --- a/src/namestore/namestore.h +++ b/src/namestore/namestore.h | |||
@@ -76,7 +76,7 @@ struct LookupBlockMessage | |||
76 | struct LookupBlockResponseMessage | 76 | struct LookupBlockResponseMessage |
77 | { | 77 | { |
78 | /** | 78 | /** |
79 | * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_LOOKUP_BLOCK_RESPONSE | 79 | * Type will be #GNUNET_MESSAGE_TYPE_NAMESTORE_LOOKUP_BLOCK_RESPONSE |
80 | */ | 80 | */ |
81 | struct GNUNET_NAMESTORE_Header gns_header; | 81 | struct GNUNET_NAMESTORE_Header gns_header; |
82 | 82 | ||
diff --git a/src/namestore/namestore_api.c b/src/namestore/namestore_api.c index acb658665..b323f7cad 100644 --- a/src/namestore/namestore_api.c +++ b/src/namestore/namestore_api.c | |||
@@ -253,12 +253,12 @@ force_reconnect (struct GNUNET_NAMESTORE_Handle *h); | |||
253 | 253 | ||
254 | 254 | ||
255 | /** | 255 | /** |
256 | * Handle an incoming message of type 'GNUNET_MESSAGE_TYPE_NAMESTORE_LOOKUP_BLOCK_RESPONSE' | 256 | * Handle an incoming message of type #GNUNET_MESSAGE_TYPE_NAMESTORE_LOOKUP_BLOCK_RESPONSE. |
257 | * | 257 | * |
258 | * @param qe the respective entry in the message queue | 258 | * @param qe the respective entry in the message queue |
259 | * @param msg the message we received | 259 | * @param msg the message we received |
260 | * @param size the message size | 260 | * @param size the message size |
261 | * @return GNUNET_OK on success, GNUNET_SYSERR on error and we did NOT notify the client | 261 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error and we did NOT notify the client |
262 | */ | 262 | */ |
263 | static int | 263 | static int |
264 | handle_lookup_block_response (struct GNUNET_NAMESTORE_QueueEntry *qe, | 264 | handle_lookup_block_response (struct GNUNET_NAMESTORE_QueueEntry *qe, |
@@ -271,6 +271,14 @@ handle_lookup_block_response (struct GNUNET_NAMESTORE_QueueEntry *qe, | |||
271 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 271 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
272 | "Received `%s'\n", | 272 | "Received `%s'\n", |
273 | "LOOKUP_BLOCK_RESPONSE"); | 273 | "LOOKUP_BLOCK_RESPONSE"); |
274 | if (0 == GNUNET_TIME_absolute_ntoh (msg->expire).abs_value_us) | ||
275 | { | ||
276 | /* no match found */ | ||
277 | if (NULL != qe->block_proc) | ||
278 | qe->block_proc (qe->block_proc_cls, NULL); | ||
279 | return GNUNET_OK; | ||
280 | } | ||
281 | |||
274 | block = (struct GNUNET_NAMESTORE_Block *) buf; | 282 | block = (struct GNUNET_NAMESTORE_Block *) buf; |
275 | block->signature = msg->signature; | 283 | block->signature = msg->signature; |
276 | block->derived_key = msg->derived_key; | 284 | block->derived_key = msg->derived_key; |