aboutsummaryrefslogtreecommitdiff
path: root/src/util/mq.c
diff options
context:
space:
mode:
authorlurchi <lurchi@strangeplace.net>2017-12-14 18:19:02 +0100
committerlurchi <lurchi@strangeplace.net>2017-12-14 18:19:02 +0100
commita768af6e36718d097391ae990bac4a83282632bb (patch)
tree389b3ef9fac94e152828bea8f1d9cd7ea418bd5b /src/util/mq.c
parentcbb68b43b499da5e9b5ea3d5662f60b6f6c228b1 (diff)
parent1522bb78401dd739299cc507e7237df32f239a3f (diff)
downloadgnunet-a768af6e36718d097391ae990bac4a83282632bb.tar.gz
gnunet-a768af6e36718d097391ae990bac4a83282632bb.zip
Merge branch 'fix_social' of gnunet.org:gnunet into fix_social
Diffstat (limited to 'src/util/mq.c')
-rw-r--r--src/util/mq.c54
1 files changed, 53 insertions, 1 deletions
diff --git a/src/util/mq.c b/src/util/mq.c
index 57d2d05c5..3c1fba149 100644
--- a/src/util/mq.c
+++ b/src/util/mq.c
@@ -28,6 +28,30 @@
28 28
29#define LOG(kind,...) GNUNET_log_from (kind, "util-mq",__VA_ARGS__) 29#define LOG(kind,...) GNUNET_log_from (kind, "util-mq",__VA_ARGS__)
30 30
31//#if HAVE_EXECINFO_H
32//#include "execinfo.h"
33
34///**
35// * Use lsof to generate file descriptor reports on select error?
36// * (turn off for stable releases).
37// */
38//#define USE_LSOF GNUNET_NO
39
40///**
41// * Obtain trace information for all scheduler calls that schedule tasks.
42// */
43//#define EXECINFO GNUNET_NO
44
45///**
46// * Check each file descriptor before adding
47// */
48//#define DEBUG_FDS GNUNET_NO
49
50///**
51// * Depth of the traces collected via EXECINFO.
52// */
53//#define MAX_TRACE_DEPTH 50
54//#endif
31 55
32struct GNUNET_MQ_Envelope 56struct GNUNET_MQ_Envelope
33{ 57{
@@ -357,6 +381,12 @@ GNUNET_MQ_send (struct GNUNET_MQ_Handle *mq,
357 } 381 }
358 GNUNET_assert (NULL == mq->envelope_head); 382 GNUNET_assert (NULL == mq->envelope_head);
359 mq->current_envelope = ev; 383 mq->current_envelope = ev;
384
385 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
386 "mq: sending message of type %u, queue empty (MQ: %p)\n",
387 ntohs(ev->mh->type),
388 mq);
389
360 mq->send_impl (mq, 390 mq->send_impl (mq,
361 ev->mh, 391 ev->mh,
362 mq->impl_state); 392 mq->impl_state);
@@ -452,6 +482,11 @@ impl_send_continue (void *cls)
452 GNUNET_CONTAINER_DLL_remove (mq->envelope_head, 482 GNUNET_CONTAINER_DLL_remove (mq->envelope_head,
453 mq->envelope_tail, 483 mq->envelope_tail,
454 mq->current_envelope); 484 mq->current_envelope);
485
486 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
487 "mq: sending message of type %u from queue\n",
488 ntohs(mq->current_envelope->mh->type));
489
455 mq->send_impl (mq, 490 mq->send_impl (mq,
456 mq->current_envelope->mh, 491 mq->current_envelope->mh,
457 mq->impl_state); 492 mq->impl_state);
@@ -851,8 +886,20 @@ GNUNET_MQ_destroy (struct GNUNET_MQ_Handle *mq)
851 * are not queued! */ 886 * are not queued! */
852 mq->current_envelope->parent_queue = NULL; 887 mq->current_envelope->parent_queue = NULL;
853 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 888 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
854 "MQ destroy drops message of type %u\n", 889 "MQ destroy drops current message of type %u\n",
855 ntohs (mq->current_envelope->mh->type)); 890 ntohs (mq->current_envelope->mh->type));
891//#if EXECINFO
892// void *backtrace_array[MAX_TRACE_DEPTH];
893// int num_backtrace_strings = backtrace (backtrace_array, MAX_TRACE_DEPTH);
894// char **backtrace_strings =
895// backtrace_symbols (backtrace_array,
896// t->num_backtrace_strings);
897// for (unsigned int i = 0; i < num_backtrace_strings; i++)
898// LOG (GNUNET_ERROR_TYPE_DEBUG,
899// "client drop trace %u: %s\n",
900// i,
901// backtrace_strings[i]);
902//#endif
856 GNUNET_MQ_discard (mq->current_envelope); 903 GNUNET_MQ_discard (mq->current_envelope);
857 mq->current_envelope = NULL; 904 mq->current_envelope = NULL;
858 GNUNET_assert (0 < mq->queue_length); 905 GNUNET_assert (0 < mq->queue_length);
@@ -934,6 +981,11 @@ GNUNET_MQ_send_cancel (struct GNUNET_MQ_Envelope *ev)
934 GNUNET_CONTAINER_DLL_remove (mq->envelope_head, 981 GNUNET_CONTAINER_DLL_remove (mq->envelope_head,
935 mq->envelope_tail, 982 mq->envelope_tail,
936 mq->current_envelope); 983 mq->current_envelope);
984
985 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
986 "mq: sending canceled message of type %u queue\n",
987 ntohs(ev->mh->type));
988
937 mq->send_impl (mq, 989 mq->send_impl (mq,
938 mq->current_envelope->mh, 990 mq->current_envelope->mh,
939 mq->impl_state); 991 mq->impl_state);