aboutsummaryrefslogtreecommitdiff
path: root/src/revocation/gnunet-service-revocation.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-03-20 23:29:14 +0000
committerChristian Grothoff <christian@grothoff.org>2015-03-20 23:29:14 +0000
commitddc55c4321748e6f39b229d0993479f25b62984c (patch)
treef90ef289e05819260a32941007d416b5c286b6d7 /src/revocation/gnunet-service-revocation.c
parent5bcc3793bcec0ab29d0cb67344f43683855df0c3 (diff)
downloadgnunet-ddc55c4321748e6f39b229d0993479f25b62984c.tar.gz
gnunet-ddc55c4321748e6f39b229d0993479f25b62984c.zip
fix #3721
Diffstat (limited to 'src/revocation/gnunet-service-revocation.c')
-rw-r--r--src/revocation/gnunet-service-revocation.c27
1 files changed, 22 insertions, 5 deletions
diff --git a/src/revocation/gnunet-service-revocation.c b/src/revocation/gnunet-service-revocation.c
index 0e3e6c5af..f5ed5fcbc 100644
--- a/src/revocation/gnunet-service-revocation.c
+++ b/src/revocation/gnunet-service-revocation.c
@@ -512,14 +512,27 @@ handle_core_connect (void *cls,
512 struct GNUNET_HashCode my_hash; 512 struct GNUNET_HashCode my_hash;
513 struct GNUNET_HashCode peer_hash; 513 struct GNUNET_HashCode peer_hash;
514 514
515 if (0 == memcmp(peer, 515 if (0 == memcmp (peer,
516 &my_identity, 516 &my_identity,
517 sizeof (my_identity))) 517 sizeof (my_identity)))
518 return; 518 {
519 GNUNET_break (0);
520 return;
521 }
519 522
520 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 523 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
521 "Peer `%s' connected to us\n", 524 "Peer `%s' connected to us\n",
522 GNUNET_i2s (peer)); 525 GNUNET_i2s (peer));
526 peer_entry = GNUNET_CONTAINER_multipeermap_get (peers,
527 peer);
528 if (NULL != peer_entry)
529 {
530 /* This can happen if "core"'s notification is a tad late
531 and CADET+SET were faster and already produced a
532 #handle_revocation_union_request() for us to deal
533 with. This should be rare, but isn't impossible. */
534 return;
535 }
523 peer_entry = GNUNET_new (struct PeerEntry); 536 peer_entry = GNUNET_new (struct PeerEntry);
524 peer_entry->id = *peer; 537 peer_entry->id = *peer;
525 GNUNET_assert (GNUNET_OK == 538 GNUNET_assert (GNUNET_OK ==
@@ -568,7 +581,10 @@ handle_core_disconnect (void *cls,
568 if (0 == memcmp (peer, 581 if (0 == memcmp (peer,
569 &my_identity, 582 &my_identity,
570 sizeof (my_identity))) 583 sizeof (my_identity)))
584 {
585 GNUNET_break (0);
571 return; 586 return;
587 }
572 588
573 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 589 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
574 "Peer `%s' disconnected from us\n", 590 "Peer `%s' disconnected from us\n",
@@ -728,7 +744,8 @@ handle_revocation_union_request (void *cls,
728 peer_entry = GNUNET_new (struct PeerEntry); 744 peer_entry = GNUNET_new (struct PeerEntry);
729 peer_entry->id = *other_peer; 745 peer_entry->id = *other_peer;
730 GNUNET_assert (GNUNET_OK == 746 GNUNET_assert (GNUNET_OK ==
731 GNUNET_CONTAINER_multipeermap_put (peers, other_peer, 747 GNUNET_CONTAINER_multipeermap_put (peers,
748 other_peer,
732 peer_entry, 749 peer_entry,
733 GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY)); 750 GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY));
734 } 751 }