diff options
author | Christian Grothoff <christian@grothoff.org> | 2017-03-13 18:11:44 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2017-03-13 18:11:44 +0100 |
commit | 0fa8b5ac59032c65f1f2a447863b334668cacda0 (patch) | |
tree | 8bf2d5efde5ded89bd33f80dd360e165efde06ae /src/util/mq.c | |
parent | 7898eb1be882b49db0ed0613839d094c79c6275a (diff) | |
download | gnunet-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.c | 24 |
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 | */ | ||
820 | void * | 830 | void * |
821 | GNUNET_MQ_assoc_get (struct GNUNET_MQ_Handle *mq, | 831 | GNUNET_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 | */ | ||
830 | void * | 848 | void * |
831 | GNUNET_MQ_assoc_remove (struct GNUNET_MQ_Handle *mq, | 849 | GNUNET_MQ_assoc_remove (struct GNUNET_MQ_Handle *mq, |
832 | uint32_t request_id) | 850 | uint32_t request_id) |