aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-01-17 11:22:00 +0100
committerChristian Grothoff <christian@grothoff.org>2017-01-17 11:22:10 +0100
commitd0bb14e2a958f4f816c6c006dd8b7a979e6de289 (patch)
treeb69929ede9560daf5c298b4e3abe7e109f8daa05 /src
parent9407ee77841b771e774d51eaa2916bceed047c86 (diff)
downloadgnunet-d0bb14e2a958f4f816c6c006dd8b7a979e6de289.tar.gz
gnunet-d0bb14e2a958f4f816c6c006dd8b7a979e6de289.zip
replace redundant MQ_NotifyCallback by SCHEDULER_TaskCallback
Diffstat (limited to 'src')
-rw-r--r--src/include/gnunet_mq_lib.h11
-rw-r--r--src/include/gnunet_peerinfo_service.h2
-rw-r--r--src/multicast/multicast_api.c2
-rw-r--r--src/peerinfo/peerinfo_api.c2
-rw-r--r--src/psyc/psyc_api.c2
-rw-r--r--src/social/social_api.c4
-rw-r--r--src/util/mq.c22
7 files changed, 18 insertions, 27 deletions
diff --git a/src/include/gnunet_mq_lib.h b/src/include/gnunet_mq_lib.h
index 5c2f808df..108ba5d54 100644
--- a/src/include/gnunet_mq_lib.h
+++ b/src/include/gnunet_mq_lib.h
@@ -255,15 +255,6 @@ typedef void
255 255
256 256
257/** 257/**
258 * Callback used for notifications
259 *
260 * @param cls closure
261 */
262typedef void
263(*GNUNET_MQ_NotifyCallback) (void *cls);
264
265
266/**
267 * Generic error handler, called with the appropriate 258 * Generic error handler, called with the appropriate
268 * error code and the same closure specified at the creation of 259 * error code and the same closure specified at the creation of
269 * the message queue. 260 * the message queue.
@@ -634,7 +625,7 @@ GNUNET_MQ_set_handlers_closure (struct GNUNET_MQ_Handle *mq,
634 */ 625 */
635void 626void
636GNUNET_MQ_notify_sent (struct GNUNET_MQ_Envelope *ev, 627GNUNET_MQ_notify_sent (struct GNUNET_MQ_Envelope *ev,
637 GNUNET_MQ_NotifyCallback cb, 628 GNUNET_SCHEDULER_TaskCallback cb,
638 void *cb_cls); 629 void *cb_cls);
639 630
640 631
diff --git a/src/include/gnunet_peerinfo_service.h b/src/include/gnunet_peerinfo_service.h
index 44df483a0..b5c2153ac 100644
--- a/src/include/gnunet_peerinfo_service.h
+++ b/src/include/gnunet_peerinfo_service.h
@@ -101,7 +101,7 @@ GNUNET_PEERINFO_disconnect (struct GNUNET_PEERINFO_Handle *h);
101struct GNUNET_MQ_Envelope * 101struct GNUNET_MQ_Envelope *
102GNUNET_PEERINFO_add_peer (struct GNUNET_PEERINFO_Handle *h, 102GNUNET_PEERINFO_add_peer (struct GNUNET_PEERINFO_Handle *h,
103 const struct GNUNET_HELLO_Message *hello, 103 const struct GNUNET_HELLO_Message *hello,
104 GNUNET_MQ_NotifyCallback cont, 104 GNUNET_SCHEDULER_TaskCallback cont,
105 void *cont_cls); 105 void *cont_cls);
106 106
107 107
diff --git a/src/multicast/multicast_api.c b/src/multicast/multicast_api.c
index 6e5402b28..a8b1dee40 100644
--- a/src/multicast/multicast_api.c
+++ b/src/multicast/multicast_api.c
@@ -556,7 +556,7 @@ group_disconnect (struct GNUNET_MULTICAST_Group *grp,
556 if (NULL != last) 556 if (NULL != last)
557 { 557 {
558 GNUNET_MQ_notify_sent (last, 558 GNUNET_MQ_notify_sent (last,
559 (GNUNET_MQ_NotifyCallback) group_cleanup, grp); 559 (GNUNET_SCHEDULER_TaskCallback) group_cleanup, grp);
560 } 560 }
561 else 561 else
562 { 562 {
diff --git a/src/peerinfo/peerinfo_api.c b/src/peerinfo/peerinfo_api.c
index 10729f3d0..b75d4e291 100644
--- a/src/peerinfo/peerinfo_api.c
+++ b/src/peerinfo/peerinfo_api.c
@@ -557,7 +557,7 @@ GNUNET_PEERINFO_iterate_cancel (struct GNUNET_PEERINFO_IteratorContext *ic)
557struct GNUNET_MQ_Envelope * 557struct GNUNET_MQ_Envelope *
558GNUNET_PEERINFO_add_peer (struct GNUNET_PEERINFO_Handle *h, 558GNUNET_PEERINFO_add_peer (struct GNUNET_PEERINFO_Handle *h,
559 const struct GNUNET_HELLO_Message *hello, 559 const struct GNUNET_HELLO_Message *hello,
560 GNUNET_MQ_NotifyCallback cont, 560 GNUNET_SCHEDULER_TaskCallback cont,
561 void *cont_cls) 561 void *cont_cls)
562{ 562{
563 struct GNUNET_MQ_Envelope *env; 563 struct GNUNET_MQ_Envelope *env;
diff --git a/src/psyc/psyc_api.c b/src/psyc/psyc_api.c
index d744e7d08..c6544df3a 100644
--- a/src/psyc/psyc_api.c
+++ b/src/psyc/psyc_api.c
@@ -598,7 +598,7 @@ channel_disconnect (struct GNUNET_PSYC_Channel *chn,
598 struct GNUNET_MQ_Envelope *env = GNUNET_MQ_get_last_envelope (chn->mq); 598 struct GNUNET_MQ_Envelope *env = GNUNET_MQ_get_last_envelope (chn->mq);
599 if (NULL != env) 599 if (NULL != env)
600 { 600 {
601 GNUNET_MQ_notify_sent (env, (GNUNET_MQ_NotifyCallback) channel_cleanup, chn); 601 GNUNET_MQ_notify_sent (env, (GNUNET_SCHEDULER_TaskCallback) channel_cleanup, chn);
602 } 602 }
603 else 603 else
604 { 604 {
diff --git a/src/social/social_api.c b/src/social/social_api.c
index 82928a258..a7fe0916f 100644
--- a/src/social/social_api.c
+++ b/src/social/social_api.c
@@ -1087,7 +1087,7 @@ place_disconnect (struct GNUNET_SOCIAL_Place *plc,
1087 struct GNUNET_MQ_Envelope *env = GNUNET_MQ_get_last_envelope (plc->mq); 1087 struct GNUNET_MQ_Envelope *env = GNUNET_MQ_get_last_envelope (plc->mq);
1088 if (NULL != env) 1088 if (NULL != env)
1089 { 1089 {
1090 GNUNET_MQ_notify_sent (env, (GNUNET_MQ_NotifyCallback) place_cleanup, plc); 1090 GNUNET_MQ_notify_sent (env, (GNUNET_SCHEDULER_TaskCallback) place_cleanup, plc);
1091 } 1091 }
1092 else 1092 else
1093 { 1093 {
@@ -2701,7 +2701,7 @@ GNUNET_SOCIAL_app_disconnect (struct GNUNET_SOCIAL_App *app,
2701 struct GNUNET_MQ_Envelope *env = GNUNET_MQ_get_last_envelope (app->mq); 2701 struct GNUNET_MQ_Envelope *env = GNUNET_MQ_get_last_envelope (app->mq);
2702 if (NULL != env) 2702 if (NULL != env)
2703 { 2703 {
2704 GNUNET_MQ_notify_sent (env, (GNUNET_MQ_NotifyCallback) app_cleanup, app); 2704 GNUNET_MQ_notify_sent (env, (GNUNET_SCHEDULER_TaskCallback) app_cleanup, app);
2705 } 2705 }
2706 else 2706 else
2707 { 2707 {
diff --git a/src/util/mq.c b/src/util/mq.c
index ae13ff601..985e86331 100644
--- a/src/util/mq.c
+++ b/src/util/mq.c
@@ -58,7 +58,7 @@ struct GNUNET_MQ_Envelope
58 /** 58 /**
59 * Called after the message was sent irrevocably. 59 * Called after the message was sent irrevocably.
60 */ 60 */
61 GNUNET_MQ_NotifyCallback sent_cb; 61 GNUNET_SCHEDULER_TaskCallback sent_cb;
62 62
63 /** 63 /**
64 * Closure for @e send_cb 64 * Closure for @e send_cb
@@ -128,10 +128,10 @@ struct GNUNET_MQ_Handle
128 void *error_handler_cls; 128 void *error_handler_cls;
129 129
130 /** 130 /**
131 * Task to asynchronously run #impl_send_continue(). 131 * Task to asynchronously run #impl_send_continue().
132 */ 132 */
133 struct GNUNET_SCHEDULER_Task *send_task; 133 struct GNUNET_SCHEDULER_Task *send_task;
134 134
135 /** 135 /**
136 * Linked list of messages pending to be sent 136 * Linked list of messages pending to be sent
137 */ 137 */
@@ -414,7 +414,7 @@ static void
414impl_send_continue (void *cls) 414impl_send_continue (void *cls)
415{ 415{
416 struct GNUNET_MQ_Handle *mq = cls; 416 struct GNUNET_MQ_Handle *mq = cls;
417 417
418 mq->send_task = NULL; 418 mq->send_task = NULL;
419 /* call is only valid if we're actually currently sending 419 /* call is only valid if we're actually currently sending
420 * a message */ 420 * a message */
@@ -441,8 +441,8 @@ void
441GNUNET_MQ_impl_send_continue (struct GNUNET_MQ_Handle *mq) 441GNUNET_MQ_impl_send_continue (struct GNUNET_MQ_Handle *mq)
442{ 442{
443 struct GNUNET_MQ_Envelope *current_envelope; 443 struct GNUNET_MQ_Envelope *current_envelope;
444 GNUNET_MQ_NotifyCallback cb; 444 GNUNET_SCHEDULER_TaskCallback cb;
445 445
446 GNUNET_assert (0 < mq->queue_length); 446 GNUNET_assert (0 < mq->queue_length);
447 mq->queue_length--; 447 mq->queue_length--;
448 mq->in_flight = GNUNET_NO; 448 mq->in_flight = GNUNET_NO;
@@ -456,7 +456,7 @@ GNUNET_MQ_impl_send_continue (struct GNUNET_MQ_Handle *mq)
456 { 456 {
457 current_envelope->sent_cb = NULL; 457 current_envelope->sent_cb = NULL;
458 cb (current_envelope->sent_cls); 458 cb (current_envelope->sent_cls);
459 } 459 }
460 GNUNET_free (current_envelope); 460 GNUNET_free (current_envelope);
461} 461}
462 462
@@ -475,8 +475,8 @@ void
475GNUNET_MQ_impl_send_in_flight (struct GNUNET_MQ_Handle *mq) 475GNUNET_MQ_impl_send_in_flight (struct GNUNET_MQ_Handle *mq)
476{ 476{
477 struct GNUNET_MQ_Envelope *current_envelope; 477 struct GNUNET_MQ_Envelope *current_envelope;
478 GNUNET_MQ_NotifyCallback cb; 478 GNUNET_SCHEDULER_TaskCallback cb;
479 479
480 mq->in_flight = GNUNET_YES; 480 mq->in_flight = GNUNET_YES;
481 /* call is only valid if we're actually currently sending 481 /* call is only valid if we're actually currently sending
482 * a message */ 482 * a message */
@@ -812,7 +812,7 @@ GNUNET_MQ_assoc_remove (struct GNUNET_MQ_Handle *mq,
812 */ 812 */
813void 813void
814GNUNET_MQ_notify_sent (struct GNUNET_MQ_Envelope *mqm, 814GNUNET_MQ_notify_sent (struct GNUNET_MQ_Envelope *mqm,
815 GNUNET_MQ_NotifyCallback cb, 815 GNUNET_SCHEDULER_TaskCallback cb,
816 void *cb_cls) 816 void *cb_cls)
817{ 817{
818 mqm->sent_cb = cb; 818 mqm->sent_cb = cb;
@@ -953,7 +953,7 @@ GNUNET_MQ_send_cancel (struct GNUNET_MQ_Envelope *ev)
953 953
954 GNUNET_assert (NULL != mq); 954 GNUNET_assert (NULL != mq);
955 GNUNET_assert (NULL != mq->cancel_impl); 955 GNUNET_assert (NULL != mq->cancel_impl);
956 956
957 mq->evacuate_called = GNUNET_NO; 957 mq->evacuate_called = GNUNET_NO;
958 958
959 if (mq->current_envelope == ev) 959 if (mq->current_envelope == ev)