aboutsummaryrefslogtreecommitdiff
path: root/src/rps/gnunet-service-rps.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/rps/gnunet-service-rps.c')
-rw-r--r--src/rps/gnunet-service-rps.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/rps/gnunet-service-rps.c b/src/rps/gnunet-service-rps.c
index 55569866b..8fe64c2eb 100644
--- a/src/rps/gnunet-service-rps.c
+++ b/src/rps/gnunet-service-rps.c
@@ -724,7 +724,6 @@ mq_liveliness_check_successful (void *cls)
724 LOG (GNUNET_ERROR_TYPE_DEBUG, 724 LOG (GNUNET_ERROR_TYPE_DEBUG,
725 "Liveliness check for peer %s was successfull\n", 725 "Liveliness check for peer %s was successfull\n",
726 GNUNET_i2s (&peer_ctx->peer_id)); 726 GNUNET_i2s (&peer_ctx->peer_id));
727 //GNUNET_free (peer_ctx->liveliness_check_pending);
728 remove_pending_message (peer_ctx->liveliness_check_pending, GNUNET_YES); 727 remove_pending_message (peer_ctx->liveliness_check_pending, GNUNET_YES);
729 peer_ctx->liveliness_check_pending = NULL; 728 peer_ctx->liveliness_check_pending = NULL;
730 set_peer_live (peer_ctx); 729 set_peer_live (peer_ctx);
@@ -747,10 +746,6 @@ check_peer_live (struct PeerContext *peer_ctx)
747 struct GNUNET_MQ_Envelope *ev; 746 struct GNUNET_MQ_Envelope *ev;
748 747
749 ev = GNUNET_MQ_msg_header (GNUNET_MESSAGE_TYPE_RPS_PP_CHECK_LIVE); 748 ev = GNUNET_MQ_msg_header (GNUNET_MESSAGE_TYPE_RPS_PP_CHECK_LIVE);
750 //peer_ctx->liveliness_check_pending = GNUNET_new (struct PendingMessage);
751 //peer_ctx->liveliness_check_pending->ev = ev;
752 //peer_ctx->liveliness_check_pending->peer_ctx = peer_ctx;
753 //peer_ctx->liveliness_check_pending->type = "Check liveliness";
754 peer_ctx->liveliness_check_pending = 749 peer_ctx->liveliness_check_pending =
755 insert_pending_message (&peer_ctx->peer_id, ev, "Check liveliness"); 750 insert_pending_message (&peer_ctx->peer_id, ev, "Check liveliness");
756 mq = get_mq (&peer_ctx->peer_id); 751 mq = get_mq (&peer_ctx->peer_id);
@@ -1261,6 +1256,13 @@ Peers_remove_peer (const struct GNUNET_PeerIdentity *peer)
1261 "Removing unsent %s\n", 1256 "Removing unsent %s\n",
1262 peer_ctx->pending_messages_head->type); 1257 peer_ctx->pending_messages_head->type);
1263 /* Cancle pending message, too */ 1258 /* Cancle pending message, too */
1259 if ( (NULL != peer_ctx->liveliness_check_pending) &&
1260 (0 == memcmp (peer_ctx->pending_messages_head,
1261 peer_ctx->liveliness_check_pending,
1262 sizeof (struct PendingMessage))) )
1263 {
1264 peer_ctx->liveliness_check_pending = NULL;
1265 }
1264 remove_pending_message (peer_ctx->pending_messages_head, GNUNET_YES); 1266 remove_pending_message (peer_ctx->pending_messages_head, GNUNET_YES);
1265 } 1267 }
1266 /* If we are still waiting for notification whether this peer is live 1268 /* If we are still waiting for notification whether this peer is live
@@ -1272,7 +1274,7 @@ Peers_remove_peer (const struct GNUNET_PeerIdentity *peer)
1272 GNUNET_i2s (&peer_ctx->peer_id)); 1274 GNUNET_i2s (&peer_ctx->peer_id));
1273 // TODO wait until cadet sets mq->cancel_impl 1275 // TODO wait until cadet sets mq->cancel_impl
1274 //GNUNET_MQ_send_cancel (peer_ctx->liveliness_check_pending->ev); 1276 //GNUNET_MQ_send_cancel (peer_ctx->liveliness_check_pending->ev);
1275 GNUNET_free (peer_ctx->liveliness_check_pending); 1277 remove_pending_message (peer_ctx->liveliness_check_pending, GNUNET_YES);
1276 peer_ctx->liveliness_check_pending = NULL; 1278 peer_ctx->liveliness_check_pending = NULL;
1277 } 1279 }
1278 channel_flag = Peers_get_channel_flag (peer, Peers_CHANNEL_ROLE_SENDING); 1280 channel_flag = Peers_get_channel_flag (peer, Peers_CHANNEL_ROLE_SENDING);
@@ -3596,6 +3598,7 @@ handle_client_act_malicious (void *cls,
3596 3598
3597 num_mal_peers_sent = ntohl (msg->num_peers) - 1; 3599 num_mal_peers_sent = ntohl (msg->num_peers) - 1;
3598 num_mal_peers_old = num_mal_peers; 3600 num_mal_peers_old = num_mal_peers;
3601 GNUNET_assert (GNUNET_MAX_MALLOC_CHECKED > num_mal_peers_sent);
3599 GNUNET_array_grow (mal_peers, 3602 GNUNET_array_grow (mal_peers,
3600 num_mal_peers, 3603 num_mal_peers,
3601 num_mal_peers + num_mal_peers_sent); 3604 num_mal_peers + num_mal_peers_sent);