aboutsummaryrefslogtreecommitdiff
path: root/src/peerinfo/peerinfo_api.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-05-04 12:41:19 +0000
committerChristian Grothoff <christian@grothoff.org>2012-05-04 12:41:19 +0000
commit160410f469ac69be5c5af5f74fec82a1dff4ba71 (patch)
tree417f73c916ea4240de72aa777ff02852b9319f8e /src/peerinfo/peerinfo_api.c
parent5b4ea3e30a605c1e3752b735d0c3a1f1de39e9ed (diff)
downloadgnunet-160410f469ac69be5c5af5f74fec82a1dff4ba71.tar.gz
gnunet-160410f469ac69be5c5af5f74fec82a1dff4ba71.zip
-fixing #1969
Diffstat (limited to 'src/peerinfo/peerinfo_api.c')
-rw-r--r--src/peerinfo/peerinfo_api.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/peerinfo/peerinfo_api.c b/src/peerinfo/peerinfo_api.c
index 0ccd8a61a..b8180c3f1 100644
--- a/src/peerinfo/peerinfo_api.c
+++ b/src/peerinfo/peerinfo_api.c
@@ -481,8 +481,8 @@ GNUNET_PEERINFO_add_peer_cancel (struct GNUNET_PEERINFO_AddContext *ac)
481static void 481static void
482peerinfo_handler (void *cls, const struct GNUNET_MessageHeader *msg) 482peerinfo_handler (void *cls, const struct GNUNET_MessageHeader *msg)
483{ 483{
484 struct GNUNET_PEERINFO_IteratorContext *ic = cls; 484 struct GNUNET_PEERINFO_Handle *h = cls;
485 struct GNUNET_PEERINFO_Handle *h = ic->h; 485 struct GNUNET_PEERINFO_IteratorContext *ic = h->ic_head;
486 const struct InfoMessage *im; 486 const struct InfoMessage *im;
487 const struct GNUNET_HELLO_Message *hello; 487 const struct GNUNET_HELLO_Message *hello;
488 GNUNET_PEERINFO_Processor cb; 488 GNUNET_PEERINFO_Processor cb;
@@ -534,6 +534,11 @@ peerinfo_handler (void *cls, const struct GNUNET_MessageHeader *msg)
534 (0 != memcmp (&ic->peer, &im->peer, sizeof (struct GNUNET_PeerIdentity))) ) 534 (0 != memcmp (&ic->peer, &im->peer, sizeof (struct GNUNET_PeerIdentity))) )
535 { 535 {
536 /* bogus message (from a different iteration call?); out of sequence! */ 536 /* bogus message (from a different iteration call?); out of sequence! */
537 LOG (GNUNET_ERROR_TYPE_ERROR,
538 "Received HELLO for peer `%s', expected peer `%s'\n",
539 GNUNET_h2s (&im->peer.hashPubKey),
540 GNUNET_i2s (&ic->peer));
541
537 GNUNET_break (0); 542 GNUNET_break (0);
538 GNUNET_PEERINFO_iterate_cancel (ic); 543 GNUNET_PEERINFO_iterate_cancel (ic);
539 reconnect (h); 544 reconnect (h);
@@ -627,7 +632,7 @@ iterator_start_receive (void *cls, const char *emsg)
627 if (GNUNET_NO == h->in_receive) 632 if (GNUNET_NO == h->in_receive)
628 { 633 {
629 h->in_receive = GNUNET_YES; 634 h->in_receive = GNUNET_YES;
630 GNUNET_CLIENT_receive (h->client, &peerinfo_handler, ic, 635 GNUNET_CLIENT_receive (h->client, &peerinfo_handler, h,
631 GNUNET_TIME_absolute_get_remaining (ic->timeout)); 636 GNUNET_TIME_absolute_get_remaining (ic->timeout));
632 } 637 }
633} 638}
@@ -721,10 +726,10 @@ GNUNET_PEERINFO_iterate (struct GNUNET_PEERINFO_Handle *h,
721 GNUNET_SCHEDULER_add_delayed (timeout, &signal_timeout, ic); 726 GNUNET_SCHEDULER_add_delayed (timeout, &signal_timeout, ic);
722 ac->cont = &iterator_start_receive; 727 ac->cont = &iterator_start_receive;
723 ac->cont_cls = ic; 728 ac->cont_cls = ic;
724 GNUNET_CONTAINER_DLL_insert_after (h->ac_head, h->ac_tail, h->ac_tail, ac); 729 GNUNET_CONTAINER_DLL_insert_tail (h->ac_head, h->ac_tail, ac);
725 GNUNET_CONTAINER_DLL_insert (h->ic_head, 730 GNUNET_CONTAINER_DLL_insert_tail (h->ic_head,
726 h->ic_tail, 731 h->ic_tail,
727 ic); 732 ic);
728 trigger_transmit (h); 733 trigger_transmit (h);
729 return ic; 734 return ic;
730} 735}