aboutsummaryrefslogtreecommitdiff
path: root/src/peerstore
diff options
context:
space:
mode:
authorMartin Schanzenbach <mschanzenbach@posteo.de>2016-05-29 11:19:50 +0000
committerMartin Schanzenbach <mschanzenbach@posteo.de>2016-05-29 11:19:50 +0000
commitb5454a701bde16ebc577fbb87d09f5dc1ead587e (patch)
treeaf5eac846653e86cff5bf158a1e740459fd438e5 /src/peerstore
parente0c01618605c1ef2901b2002aed6801858603305 (diff)
downloadgnunet-b5454a701bde16ebc577fbb87d09f5dc1ead587e.tar.gz
gnunet-b5454a701bde16ebc577fbb87d09f5dc1ead587e.zip
- Fix #4532
Diffstat (limited to 'src/peerstore')
-rw-r--r--src/peerstore/gnunet-service-peerstore.c5
-rw-r--r--src/peerstore/peerstore_api.c8
2 files changed, 4 insertions, 9 deletions
diff --git a/src/peerstore/gnunet-service-peerstore.c b/src/peerstore/gnunet-service-peerstore.c
index 048201c77..af6438bb2 100644
--- a/src/peerstore/gnunet-service-peerstore.c
+++ b/src/peerstore/gnunet-service-peerstore.c
@@ -251,7 +251,7 @@ handle_client_disconnect (void *cls, struct GNUNET_SERVER_Client *client)
251 * @param emsg error message or NULL if no errors 251 * @param emsg error message or NULL if no errors
252 * @return #GNUNET_YES to continue iteration 252 * @return #GNUNET_YES to continue iteration
253 */ 253 */
254static int 254static void
255record_iterator (void *cls, const struct GNUNET_PEERSTORE_Record *record, 255record_iterator (void *cls, const struct GNUNET_PEERSTORE_Record *record,
256 const char *emsg) 256 const char *emsg)
257{ 257{
@@ -270,7 +270,7 @@ record_iterator (void *cls, const struct GNUNET_PEERSTORE_Record *record,
270 GNUNET_SERVER_receive_done (cls_record->client, 270 GNUNET_SERVER_receive_done (cls_record->client,
271 NULL == emsg ? GNUNET_OK : GNUNET_SYSERR); 271 NULL == emsg ? GNUNET_OK : GNUNET_SYSERR);
272 PEERSTORE_destroy_record (cls_record); 272 PEERSTORE_destroy_record (cls_record);
273 return GNUNET_NO; 273 return;
274 } 274 }
275 275
276 srm = 276 srm =
@@ -282,7 +282,6 @@ record_iterator (void *cls, const struct GNUNET_PEERSTORE_Record *record,
282 (struct GNUNET_MessageHeader *) 282 (struct GNUNET_MessageHeader *)
283 srm, GNUNET_NO); 283 srm, GNUNET_NO);
284 GNUNET_free (srm); 284 GNUNET_free (srm);
285 return GNUNET_YES;
286} 285}
287 286
288 287
diff --git a/src/peerstore/peerstore_api.c b/src/peerstore/peerstore_api.c
index f1c5ccd32..0339ff93a 100644
--- a/src/peerstore/peerstore_api.c
+++ b/src/peerstore/peerstore_api.c
@@ -670,7 +670,6 @@ handle_iterate_result (void *cls, const struct GNUNET_MessageHeader *msg)
670 void *callback_cls; 670 void *callback_cls;
671 uint16_t msg_type; 671 uint16_t msg_type;
672 struct GNUNET_PEERSTORE_Record *record; 672 struct GNUNET_PEERSTORE_Record *record;
673 int continue_iter;
674 673
675 ic = h->iterate_head; 674 ic = h->iterate_head;
676 if (NULL == ic) 675 if (NULL == ic)
@@ -704,16 +703,13 @@ handle_iterate_result (void *cls, const struct GNUNET_MessageHeader *msg)
704 { 703 {
705 record = PEERSTORE_parse_record_message (msg); 704 record = PEERSTORE_parse_record_message (msg);
706 if (NULL == record) 705 if (NULL == record)
707 continue_iter = 706 callback (callback_cls, NULL,
708 callback (callback_cls, NULL,
709 _("Received a malformed response from service.")); 707 _("Received a malformed response from service."));
710 else 708 else
711 { 709 {
712 continue_iter = callback (callback_cls, record, NULL); 710 callback (callback_cls, record, NULL);
713 PEERSTORE_destroy_record (record); 711 PEERSTORE_destroy_record (record);
714 } 712 }
715 if (GNUNET_NO == continue_iter)
716 ic->callback = NULL;
717 } 713 }
718} 714}
719 715