aboutsummaryrefslogtreecommitdiff
path: root/src/rps
diff options
context:
space:
mode:
authorJulius Bünger <buenger@mytum.de>2017-12-29 00:45:57 +0100
committerJulius Bünger <buenger@mytum.de>2017-12-29 00:47:41 +0100
commit6aff933441751d07823546e942b8e4c368f1119d (patch)
tree10d230099ec02ae57abb7aa4b6077339ece7e821 /src/rps
parentb36a7b8fb99473e15dacdbdd5431eafabb80f6e2 (diff)
downloadgnunet-6aff933441751d07823546e942b8e4c368f1119d.tar.gz
gnunet-6aff933441751d07823546e942b8e4c368f1119d.zip
rps: prepare cancellation of messages
Diffstat (limited to 'src/rps')
-rw-r--r--src/rps/gnunet-service-rps_peers.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/rps/gnunet-service-rps_peers.c b/src/rps/gnunet-service-rps_peers.c
index 9cc4d3228..1c7bd07f8 100644
--- a/src/rps/gnunet-service-rps_peers.c
+++ b/src/rps/gnunet-service-rps_peers.c
@@ -653,9 +653,10 @@ insert_pending_message (const struct GNUNET_PeerIdentity *peer,
653 * @brief Remove a pending message from the respective DLL 653 * @brief Remove a pending message from the respective DLL
654 * 654 *
655 * @param pending_msg the pending message to remove 655 * @param pending_msg the pending message to remove
656 * @param cancel cancel the pending message, too
656 */ 657 */
657static void 658static void
658remove_pending_message (struct PendingMessage *pending_msg) 659remove_pending_message (struct PendingMessage *pending_msg, int cancel)
659{ 660{
660 struct PeerContext *peer_ctx; 661 struct PeerContext *peer_ctx;
661 662
@@ -663,7 +664,11 @@ remove_pending_message (struct PendingMessage *pending_msg)
663 GNUNET_CONTAINER_DLL_remove (peer_ctx->pending_messages_head, 664 GNUNET_CONTAINER_DLL_remove (peer_ctx->pending_messages_head,
664 peer_ctx->pending_messages_tail, 665 peer_ctx->pending_messages_tail,
665 pending_msg); 666 pending_msg);
666 GNUNET_MQ_send_cancel (peer_ctx->pending_messages_head->ev); 667 // TODO wait for the cadet implementation of message cancellation
668 //if (GNUNET_YES == cancel)
669 //{
670 // GNUNET_MQ_send_cancel (pending_msg->ev);
671 //}
667 GNUNET_free (pending_msg); 672 GNUNET_free (pending_msg);
668} 673}
669 674
@@ -728,7 +733,8 @@ mq_notify_sent_cb (void *cls)
728 LOG (GNUNET_ERROR_TYPE_DEBUG, 733 LOG (GNUNET_ERROR_TYPE_DEBUG,
729 "%s was sent.\n", 734 "%s was sent.\n",
730 pending_msg->type); 735 pending_msg->type);
731 remove_pending_message (pending_msg); 736 /* Do not cancle message */
737 remove_pending_message (pending_msg, GNUNET_NO);
732} 738}
733 739
734 740
@@ -1154,7 +1160,8 @@ Peers_remove_peer (const struct GNUNET_PeerIdentity *peer)
1154 LOG (GNUNET_ERROR_TYPE_DEBUG, 1160 LOG (GNUNET_ERROR_TYPE_DEBUG,
1155 "Removing unsent %s\n", 1161 "Removing unsent %s\n",
1156 peer_ctx->pending_messages_head->type); 1162 peer_ctx->pending_messages_head->type);
1157 remove_pending_message (peer_ctx->pending_messages_head); 1163 /* Cancle pending message, too */
1164 remove_pending_message (peer_ctx->pending_messages_head, GNUNET_YES);
1158 } 1165 }
1159 /* If we are still waiting for notification whether this peer is live 1166 /* If we are still waiting for notification whether this peer is live
1160 * cancel the according task */ 1167 * cancel the according task */