[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnunet] 04/04: check multihashmap32_put return value in mq
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnunet] 04/04: check multihashmap32_put return value in mq.c |
Date: |
Mon, 13 Mar 2017 18:11:06 +0100 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository gnunet.
commit 0fa8b5ac59032c65f1f2a447863b334668cacda0
Author: Christian Grothoff <address@hidden>
AuthorDate: Mon Mar 13 18:11:44 2017 +0100
check multihashmap32_put return value in mq.c
---
src/util/mq.c | 24 +++++++++++++++++++++---
1 file 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,
mq->assoc_id = 1;
}
id = mq->assoc_id++;
- GNUNET_CONTAINER_multihashmap32_put (mq->assoc_map, id, assoc_data,
-
GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY);
+ GNUNET_assert (GNUNET_OK ==
+ GNUNET_CONTAINER_multihashmap32_put (mq->assoc_map,
+ id,
+ assoc_data,
+
GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY));
return id;
}
+/**
+ * Get the data associated with a @a request_id in a queue
+ *
+ * @param mq the message queue with the association
+ * @param request_id the request id we are interested in
+ * @return the associated data
+ */
void *
GNUNET_MQ_assoc_get (struct GNUNET_MQ_Handle *mq,
uint32_t request_id)
{
if (NULL == mq->assoc_map)
return NULL;
- return GNUNET_CONTAINER_multihashmap32_get (mq->assoc_map, request_id);
+ return GNUNET_CONTAINER_multihashmap32_get (mq->assoc_map,
+ request_id);
}
+/**
+ * Remove the association for a @a request_id
+ *
+ * @param mq the message queue with the association
+ * @param request_id the request id we want to remove
+ * @return the associated data
+ */
void *
GNUNET_MQ_assoc_remove (struct GNUNET_MQ_Handle *mq,
uint32_t request_id)
--
To stop receiving notification emails like this one, please contact
address@hidden