aboutsummaryrefslogtreecommitdiff
path: root/src/peerinfo/peerinfo_api.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-05-06 00:28:52 +0000
committerChristian Grothoff <christian@grothoff.org>2012-05-06 00:28:52 +0000
commit23d8d343d5c70481ecf78ec4fafc698907f3e8a9 (patch)
treea049b76dc3191f302b41528e9381cd9d3930757f /src/peerinfo/peerinfo_api.c
parent201817c66fb0eb1d477085091bb30e3b1e832e9e (diff)
downloadgnunet-23d8d343d5c70481ecf78ec4fafc698907f3e8a9.tar.gz
gnunet-23d8d343d5c70481ecf78ec4fafc698907f3e8a9.zip
-fix
Diffstat (limited to 'src/peerinfo/peerinfo_api.c')
-rw-r--r--src/peerinfo/peerinfo_api.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/peerinfo/peerinfo_api.c b/src/peerinfo/peerinfo_api.c
index b8180c3f1..570a5dc1f 100644
--- a/src/peerinfo/peerinfo_api.c
+++ b/src/peerinfo/peerinfo_api.c
@@ -490,6 +490,7 @@ peerinfo_handler (void *cls, const struct GNUNET_MessageHeader *msg)
490 void *cb_cls; 490 void *cb_cls;
491 uint16_t ms; 491 uint16_t ms;
492 492
493 GNUNET_assert (NULL != ic);
493 h->in_receive = GNUNET_NO; 494 h->in_receive = GNUNET_NO;
494 ic->in_receive = GNUNET_NO; 495 ic->in_receive = GNUNET_NO;
495 cb = ic->callback; 496 cb = ic->callback;
@@ -504,17 +505,19 @@ peerinfo_handler (void *cls, const struct GNUNET_MessageHeader *msg)
504 _("Failed to receive response from `PEERINFO' service.")); 505 _("Failed to receive response from `PEERINFO' service."));
505 return; 506 return;
506 } 507 }
508
507 if (GNUNET_MESSAGE_TYPE_PEERINFO_INFO_END == ntohs (msg->type)) 509 if (GNUNET_MESSAGE_TYPE_PEERINFO_INFO_END == ntohs (msg->type))
508 { 510 {
509 /* normal end of list of peers, signal end, process next pending request */ 511 /* normal end of list of peers, signal end, process next pending request */
510 LOG (GNUNET_ERROR_TYPE_DEBUG, 512 LOG (GNUNET_ERROR_TYPE_DEBUG,
511 "Received end of list of peers from `%s' service\n", "PEERINFO"); 513 "Received end of list of peers from `%s' service\n", "PEERINFO");
512 GNUNET_PEERINFO_iterate_cancel (ic); 514 GNUNET_PEERINFO_iterate_cancel (ic);
513 trigger_transmit (h); 515 trigger_transmit (h);
514 if (NULL != cb) 516 if (NULL != cb)
515 cb (cb_cls, NULL, NULL, NULL); 517 cb (cb_cls, NULL, NULL, NULL);
516 return; 518 return;
517 } 519 }
520
518 ms = ntohs (msg->size); 521 ms = ntohs (msg->size);
519 if ((ms < sizeof (struct InfoMessage)) || 522 if ((ms < sizeof (struct InfoMessage)) ||
520 (ntohs (msg->type) != GNUNET_MESSAGE_TYPE_PEERINFO_INFO)) 523 (ntohs (msg->type) != GNUNET_MESSAGE_TYPE_PEERINFO_INFO))
@@ -593,7 +596,7 @@ peerinfo_handler (void *cls, const struct GNUNET_MessageHeader *msg)
593 GNUNET_i2s (&im->peer), "PEERINFO"); 596 GNUNET_i2s (&im->peer), "PEERINFO");
594 h->in_receive = GNUNET_YES; 597 h->in_receive = GNUNET_YES;
595 ic->in_receive = GNUNET_YES; 598 ic->in_receive = GNUNET_YES;
596 GNUNET_CLIENT_receive (h->client, &peerinfo_handler, ic, 599 GNUNET_CLIENT_receive (h->client, &peerinfo_handler, h,
597 GNUNET_TIME_absolute_get_remaining (ic->timeout)); 600 GNUNET_TIME_absolute_get_remaining (ic->timeout));
598 if (NULL != cb) 601 if (NULL != cb)
599 cb (cb_cls, &im->peer, hello, NULL); 602 cb (cb_cls, &im->peer, hello, NULL);