aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2013-07-10 01:31:13 +0000
committerFlorian Dold <florian.dold@gmail.com>2013-07-10 01:31:13 +0000
commit6b8400966a5e6c2194785b3a33f91b748cfa7b7b (patch)
tree0dafa7ba24c7a6dbb852fdedfd1822cd1e4835c0 /src/util
parent084cb3e09007ef50a3d9bd29514c8ec455249633 (diff)
downloadgnunet-6b8400966a5e6c2194785b3a33f91b748cfa7b7b.tar.gz
gnunet-6b8400966a5e6c2194785b3a33f91b748cfa7b7b.zip
- set service working
- set profiler
Diffstat (limited to 'src/util')
-rw-r--r--src/util/mq.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/util/mq.c b/src/util/mq.c
index f318dd04a..04129a7b4 100644
--- a/src/util/mq.c
+++ b/src/util/mq.c
@@ -612,6 +612,7 @@ connection_client_send_impl (struct GNUNET_MQ_Handle *mq,
612struct GNUNET_MQ_Handle * 612struct GNUNET_MQ_Handle *
613GNUNET_MQ_queue_for_connection_client (struct GNUNET_CLIENT_Connection *connection, 613GNUNET_MQ_queue_for_connection_client (struct GNUNET_CLIENT_Connection *connection,
614 const struct GNUNET_MQ_MessageHandler *handlers, 614 const struct GNUNET_MQ_MessageHandler *handlers,
615 GNUNET_MQ_ErrorHandler error_handler,
615 void *cls) 616 void *cls)
616{ 617{
617 struct GNUNET_MQ_Handle *mq; 618 struct GNUNET_MQ_Handle *mq;
@@ -621,6 +622,7 @@ GNUNET_MQ_queue_for_connection_client (struct GNUNET_CLIENT_Connection *connecti
621 622
622 mq = GNUNET_new (struct GNUNET_MQ_Handle); 623 mq = GNUNET_new (struct GNUNET_MQ_Handle);
623 mq->handlers = handlers; 624 mq->handlers = handlers;
625 mq->error_handler = error_handler;
624 mq->handlers_cls = cls; 626 mq->handlers_cls = cls;
625 state = GNUNET_new (struct ClientConnectionState); 627 state = GNUNET_new (struct ClientConnectionState);
626 state->connection = connection; 628 state->connection = connection;
@@ -708,18 +710,29 @@ GNUNET_MQ_notify_sent (struct GNUNET_MQ_Envelope *mqm,
708void 710void
709GNUNET_MQ_destroy (struct GNUNET_MQ_Handle *mq) 711GNUNET_MQ_destroy (struct GNUNET_MQ_Handle *mq)
710{ 712{
711 /* FIXME: destroy all pending messages in the queue */
712
713 if (NULL != mq->destroy_impl) 713 if (NULL != mq->destroy_impl)
714 { 714 {
715 mq->destroy_impl (mq, mq->impl_state); 715 mq->destroy_impl (mq, mq->impl_state);
716 } 716 }
717 717
718 while (NULL != mq->envelope_head)
719 {
720 struct GNUNET_MQ_Envelope *ev;
721 ev = mq->envelope_head;
722 GNUNET_MQ_discard (ev);
723 GNUNET_CONTAINER_DLL_remove (mq->envelope_head, mq->envelope_tail, ev);
724 }
725
726 if (NULL != mq->current_envelope)
727 {
728 GNUNET_MQ_discard (mq->current_envelope);
729 mq->current_envelope = NULL;
730 }
731
718 GNUNET_free (mq); 732 GNUNET_free (mq);
719} 733}
720 734
721 735
722
723struct GNUNET_MessageHeader * 736struct GNUNET_MessageHeader *
724GNUNET_MQ_extract_nested_mh_ (const struct GNUNET_MessageHeader *mh, uint16_t base_size) 737GNUNET_MQ_extract_nested_mh_ (const struct GNUNET_MessageHeader *mh, uint16_t base_size)
725{ 738{