aboutsummaryrefslogtreecommitdiff
path: root/src/util/mq.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-03-13 18:11:44 +0100
committerChristian Grothoff <christian@grothoff.org>2017-03-13 18:11:44 +0100
commit0fa8b5ac59032c65f1f2a447863b334668cacda0 (patch)
tree8bf2d5efde5ded89bd33f80dd360e165efde06ae /src/util/mq.c
parent7898eb1be882b49db0ed0613839d094c79c6275a (diff)
downloadgnunet-0fa8b5ac59032c65f1f2a447863b334668cacda0.tar.gz
gnunet-0fa8b5ac59032c65f1f2a447863b334668cacda0.zip
check multihashmap32_put return value in mq.c
Diffstat (limited to 'src/util/mq.c')
-rw-r--r--src/util/mq.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/util/mq.c b/src/util/mq.c
index 79e2d0455..25cf24e11 100644
--- a/src/util/mq.c
+++ b/src/util/mq.c
@@ -811,22 +811,40 @@ GNUNET_MQ_assoc_add (struct GNUNET_MQ_Handle *mq,
811 mq->assoc_id = 1; 811 mq->assoc_id = 1;
812 } 812 }
813 id = mq->assoc_id++; 813 id = mq->assoc_id++;
814 GNUNET_CONTAINER_multihashmap32_put (mq->assoc_map, id, assoc_data, 814 GNUNET_assert (GNUNET_OK ==
815 GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY); 815 GNUNET_CONTAINER_multihashmap32_put (mq->assoc_map,
816 id,
817 assoc_data,
818 GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY));
816 return id; 819 return id;
817} 820}
818 821
819 822
823/**
824 * Get the data associated with a @a request_id in a queue
825 *
826 * @param mq the message queue with the association
827 * @param request_id the request id we are interested in
828 * @return the associated data
829 */
820void * 830void *
821GNUNET_MQ_assoc_get (struct GNUNET_MQ_Handle *mq, 831GNUNET_MQ_assoc_get (struct GNUNET_MQ_Handle *mq,
822 uint32_t request_id) 832 uint32_t request_id)
823{ 833{
824 if (NULL == mq->assoc_map) 834 if (NULL == mq->assoc_map)
825 return NULL; 835 return NULL;
826 return GNUNET_CONTAINER_multihashmap32_get (mq->assoc_map, request_id); 836 return GNUNET_CONTAINER_multihashmap32_get (mq->assoc_map,
837 request_id);
827} 838}
828 839
829 840
841/**
842 * Remove the association for a @a request_id
843 *
844 * @param mq the message queue with the association
845 * @param request_id the request id we want to remove
846 * @return the associated data
847 */
830void * 848void *
831GNUNET_MQ_assoc_remove (struct GNUNET_MQ_Handle *mq, 849GNUNET_MQ_assoc_remove (struct GNUNET_MQ_Handle *mq,
832 uint32_t request_id) 850 uint32_t request_id)