diff options
author | Christian Grothoff <christian@grothoff.org> | 2017-10-29 11:24:52 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2017-10-29 11:24:52 +0100 |
commit | e1e838cdb804ed54aedccf5fce030ecc066028cd (patch) | |
tree | 47998025c07d096fd2b567e72d3ef3fc51d4171c /src/util/mq.c | |
parent | da376896f525195c469cee2d1a4a5cb57ad6b6f8 (diff) | |
download | gnunet-e1e838cdb804ed54aedccf5fce030ecc066028cd.tar.gz gnunet-e1e838cdb804ed54aedccf5fce030ecc066028cd.zip |
better logging of message processing errors in mq handling
Diffstat (limited to 'src/util/mq.c')
-rw-r--r-- | src/util/mq.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/util/mq.c b/src/util/mq.c index c7ed5330e..6ad6b82eb 100644 --- a/src/util/mq.c +++ b/src/util/mq.c | |||
@@ -221,8 +221,10 @@ GNUNET_MQ_inject_message (struct GNUNET_MQ_Handle *mq, | |||
221 | uint16_t mtype = ntohs (mh->type); | 221 | uint16_t mtype = ntohs (mh->type); |
222 | 222 | ||
223 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 223 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
224 | "Received message of type %u and size %u\n", | 224 | "Queue %p received message of type %u and size %u\n", |
225 | mtype, msize); | 225 | mq, |
226 | mtype, | ||
227 | msize); | ||
226 | 228 | ||
227 | if (NULL == mq->handlers) | 229 | if (NULL == mq->handlers) |
228 | goto done; | 230 | goto done; |
@@ -359,7 +361,8 @@ GNUNET_MQ_send (struct GNUNET_MQ_Handle *mq, | |||
359 | mq->current_envelope = ev; | 361 | mq->current_envelope = ev; |
360 | 362 | ||
361 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 363 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
362 | "mq: sending message of type %u, queue empty\n", ntohs(ev->mh->type)); | 364 | "mq: sending message of type %u, queue empty\n", |
365 | ntohs(ev->mh->type)); | ||
363 | 366 | ||
364 | mq->send_impl (mq, | 367 | mq->send_impl (mq, |
365 | ev->mh, | 368 | ev->mh, |
@@ -848,6 +851,9 @@ GNUNET_MQ_destroy (struct GNUNET_MQ_Handle *mq) | |||
848 | ev); | 851 | ev); |
849 | GNUNET_assert (0 < mq->queue_length); | 852 | GNUNET_assert (0 < mq->queue_length); |
850 | mq->queue_length--; | 853 | mq->queue_length--; |
854 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | ||
855 | "MQ destroy drops message of type %u\n", | ||
856 | ntohs (ev->mh->type)); | ||
851 | GNUNET_MQ_discard (ev); | 857 | GNUNET_MQ_discard (ev); |
852 | } | 858 | } |
853 | if (NULL != mq->current_envelope) | 859 | if (NULL != mq->current_envelope) |
@@ -855,6 +861,9 @@ GNUNET_MQ_destroy (struct GNUNET_MQ_Handle *mq) | |||
855 | /* we can only discard envelopes that | 861 | /* we can only discard envelopes that |
856 | * are not queued! */ | 862 | * are not queued! */ |
857 | mq->current_envelope->parent_queue = NULL; | 863 | mq->current_envelope->parent_queue = NULL; |
864 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | ||
865 | "MQ destroy drops message of type %u\n", | ||
866 | ntohs (mq->current_envelope->mh->type)); | ||
858 | GNUNET_MQ_discard (mq->current_envelope); | 867 | GNUNET_MQ_discard (mq->current_envelope); |
859 | mq->current_envelope = NULL; | 868 | mq->current_envelope = NULL; |
860 | GNUNET_assert (0 < mq->queue_length); | 869 | GNUNET_assert (0 < mq->queue_length); |