summaryrefslogtreecommitdiff
path: root/src/namestore/namestore_api.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-09-10 10:50:04 +0000
committerChristian Grothoff <christian@grothoff.org>2013-09-10 10:50:04 +0000
commita012cdcb14c71e2a259ac84c13baa9c22c68a0c8 (patch)
treef9d2eaeb9dfb0e6e3e7b28bb03b2fb9c064d79ca /src/namestore/namestore_api.c
parentb73ad06bd39b3d005c22ffcfe8423a5c9d92b37e (diff)
downloadgnunet-a012cdcb14c71e2a259ac84c13baa9c22c68a0c8.tar.gz
gnunet-a012cdcb14c71e2a259ac84c13baa9c22c68a0c8.zip
-fix crash in gnunet-namestore -a if no other records already existed
Diffstat (limited to 'src/namestore/namestore_api.c')
-rw-r--r--src/namestore/namestore_api.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/namestore/namestore_api.c b/src/namestore/namestore_api.c
index 9e2e13066..a57aa2967 100644
--- a/src/namestore/namestore_api.c
+++ b/src/namestore/namestore_api.c
@@ -416,13 +416,13 @@ handle_record_result (struct GNUNET_NAMESTORE_QueueEntry *qe,
416 416
417 417
418/** 418/**
419 * Handle an incoming message of type 'GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_TO_NAME_RESPONSE' 419 * Handle an incoming message of type #GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_TO_NAME_RESPONSE.
420 * 420 *
421 * @param qe the respective entry in the message queue 421 * @param qe the respective entry in the message queue
422 * @param msg the message we received 422 * @param msg the message we received
423 * @param size the message size 423 * @param size the message size
424 * @return GNUNET_OK on success, GNUNET_NO if we notified the client about 424 * @return #GNUNET_OK on success, #GNUNET_NO if we notified the client about
425 * the error, GNUNET_SYSERR on error and we did NOT notify the client 425 * the error, #GNUNET_SYSERR on error and we did NOT notify the client
426 */ 426 */
427static int 427static int
428handle_zone_to_name_response (struct GNUNET_NAMESTORE_QueueEntry *qe, 428handle_zone_to_name_response (struct GNUNET_NAMESTORE_QueueEntry *qe,
@@ -493,10 +493,10 @@ handle_zone_to_name_response (struct GNUNET_NAMESTORE_QueueEntry *qe,
493 * 493 *
494 * @param qe the respective zone iteration handle 494 * @param qe the respective zone iteration handle
495 * @param msg the message we received 495 * @param msg the message we received
496 * @param type the message type in HBO 496 * @param type the message type in host byte order
497 * @param size the message size 497 * @param size the message size
498 * @return GNUNET_OK on success, GNUNET_NO if we notified the client about 498 * @return #GNUNET_OK on success, #GNUNET_NO if we notified the client about
499 * the error, GNUNET_SYSERR on error and we did NOT notify the client 499 * the error, #GNUNET_SYSERR on error and we did NOT notify the client
500 */ 500 */
501static int 501static int
502manage_record_operations (struct GNUNET_NAMESTORE_QueueEntry *qe, 502manage_record_operations (struct GNUNET_NAMESTORE_QueueEntry *qe,
@@ -555,8 +555,8 @@ manage_record_operations (struct GNUNET_NAMESTORE_QueueEntry *qe,
555 * @param ze the respective iterator for this operation 555 * @param ze the respective iterator for this operation
556 * @param msg the message containing the respoonse 556 * @param msg the message containing the respoonse
557 * @param size the message size 557 * @param size the message size
558 * @return GNUNET_YES on success, 'ze' should be kept, GNUNET_NO on success if 'ze' should 558 * @return #GNUNET_YES on success, @a ze should be kept, #GNUNET_NO on success if @a ze should
559 * not be kept any longer, GNUNET_SYSERR on error (disconnect) and 'ze' should be kept 559 * not be kept any longer, #GNUNET_SYSERR on error (disconnect) and @a ze should be kept
560 */ 560 */
561static int 561static int
562handle_zone_iteration_response (struct GNUNET_NAMESTORE_ZoneIterator *ze, 562handle_zone_iteration_response (struct GNUNET_NAMESTORE_ZoneIterator *ze,
@@ -587,7 +587,8 @@ handle_zone_iteration_response (struct GNUNET_NAMESTORE_ZoneIterator *ze,
587 } 587 }
588 if ((0 == name_len) && (0 == (memcmp (&msg->private_key, &priv_dummy, sizeof (priv_dummy))))) 588 if ((0 == name_len) && (0 == (memcmp (&msg->private_key, &priv_dummy, sizeof (priv_dummy)))))
589 { 589 {
590 LOG (GNUNET_ERROR_TYPE_DEBUG, "Zone iteration is completed!\n"); 590 LOG (GNUNET_ERROR_TYPE_DEBUG,
591 "Zone iteration is completed!\n");
591 if (NULL != ze->proc) 592 if (NULL != ze->proc)
592 ze->proc (ze->proc_cls, NULL, NULL, 0, NULL); 593 ze->proc (ze->proc_cls, NULL, NULL, 0, NULL);
593 return GNUNET_NO; 594 return GNUNET_NO;
@@ -621,8 +622,8 @@ handle_zone_iteration_response (struct GNUNET_NAMESTORE_ZoneIterator *ze,
621 * @param msg the message we received 622 * @param msg the message we received
622 * @param type the message type in HBO 623 * @param type the message type in HBO
623 * @param size the message size 624 * @param size the message size
624 * @return GNUNET_YES on success, 'ze' should be kept, GNUNET_NO on success if 'ze' should 625 * @return #GNUNET_YES on success, @a ze should be kept, #GNUNET_NO on success if @a ze should
625 * not be kept any longer, GNUNET_SYSERR on error (disconnect) and 'ze' should be kept 626 * not be kept any longer, #GNUNET_SYSERR on error (disconnect) and @a ze should be kept
626 */ 627 */
627static int 628static int
628manage_zone_operations (struct GNUNET_NAMESTORE_ZoneIterator *ze, 629manage_zone_operations (struct GNUNET_NAMESTORE_ZoneIterator *ze,
@@ -650,7 +651,7 @@ manage_zone_operations (struct GNUNET_NAMESTORE_ZoneIterator *ze,
650 * Type of a function to call when we receive a message 651 * Type of a function to call when we receive a message
651 * from the service. 652 * from the service.
652 * 653 *
653 * @param cls the 'struct GNUNET_NAMESTORE_SchedulingHandle' 654 * @param cls the `struct GNUNET_NAMESTORE_SchedulingHandle`
654 * @param msg message received, NULL on timeout or fatal error 655 * @param msg message received, NULL on timeout or fatal error
655 */ 656 */
656static void 657static void
@@ -710,8 +711,7 @@ process_namestore_message (void *cls,
710 GNUNET_free (qe); 711 GNUNET_free (qe);
711 } 712 }
712 } 713 }
713 714 /* Is it a zone iteration operation? */
714 /* Is it a zone iteration operation ? */
715 for (ze = h->z_head; ze != NULL; ze = ze->next) 715 for (ze = h->z_head; ze != NULL; ze = ze->next)
716 if (ze->op_id == r_id) 716 if (ze->op_id == r_id)
717 break; 717 break;