aboutsummaryrefslogtreecommitdiff
path: root/src/util/mq.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-02-04 19:13:19 +0100
committerChristian Grothoff <christian@grothoff.org>2020-02-04 19:13:19 +0100
commit4575b1275d7e507b8879c10b2714204789b7d453 (patch)
tree88144f080cb5a0b221de3dafb60047004b5960ba /src/util/mq.c
parentc656a8218c39da05d511b9c153368f63a2d92cf1 (diff)
downloadgnunet-4575b1275d7e507b8879c10b2714204789b7d453.tar.gz
gnunet-4575b1275d7e507b8879c10b2714204789b7d453.zip
indenting
Diffstat (limited to 'src/util/mq.c')
-rw-r--r--src/util/mq.c31
1 files changed, 21 insertions, 10 deletions
diff --git a/src/util/mq.c b/src/util/mq.c
index 1c1f2893f..003e0955d 100644
--- a/src/util/mq.c
+++ b/src/util/mq.c
@@ -350,7 +350,8 @@ GNUNET_MQ_get_length (struct GNUNET_MQ_Handle *mq)
350 * @param ev the envelope with the message to send. 350 * @param ev the envelope with the message to send.
351 */ 351 */
352void 352void
353GNUNET_MQ_send (struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev) 353GNUNET_MQ_send (struct GNUNET_MQ_Handle *mq,
354 struct GNUNET_MQ_Envelope *ev)
354{ 355{
355 GNUNET_assert (NULL != mq); 356 GNUNET_assert (NULL != mq);
356 GNUNET_assert (NULL == ev->parent_queue); 357 GNUNET_assert (NULL == ev->parent_queue);
@@ -368,7 +369,9 @@ GNUNET_MQ_send (struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev)
368 /* is the implementation busy? queue it! */ 369 /* is the implementation busy? queue it! */
369 if ((NULL != mq->current_envelope) || (NULL != mq->send_task)) 370 if ((NULL != mq->current_envelope) || (NULL != mq->send_task))
370 { 371 {
371 GNUNET_CONTAINER_DLL_insert_tail (mq->envelope_head, mq->envelope_tail, ev); 372 GNUNET_CONTAINER_DLL_insert_tail (mq->envelope_head,
373 mq->envelope_tail,
374 ev);
372 return; 375 return;
373 } 376 }
374 GNUNET_assert (NULL == mq->envelope_head); 377 GNUNET_assert (NULL == mq->envelope_head);
@@ -379,7 +382,9 @@ GNUNET_MQ_send (struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev)
379 ntohs (ev->mh->type), 382 ntohs (ev->mh->type),
380 mq); 383 mq);
381 384
382 mq->send_impl (mq, ev->mh, mq->impl_state); 385 mq->send_impl (mq,
386 ev->mh,
387 mq->impl_state);
383} 388}
384 389
385 390
@@ -471,7 +476,9 @@ impl_send_continue (void *cls)
471 "sending message of type %u from queue\n", 476 "sending message of type %u from queue\n",
472 ntohs (mq->current_envelope->mh->type)); 477 ntohs (mq->current_envelope->mh->type));
473 478
474 mq->send_impl (mq, mq->current_envelope->mh, mq->impl_state); 479 mq->send_impl (mq,
480 mq->current_envelope->mh,
481 mq->impl_state);
475} 482}
476 483
477 484
@@ -929,7 +936,8 @@ GNUNET_MQ_send_cancel (struct GNUNET_MQ_Envelope *ev)
929 GNUNET_assert (GNUNET_NO == mq->in_flight); 936 GNUNET_assert (GNUNET_NO == mq->in_flight);
930 GNUNET_assert (0 < mq->queue_length); 937 GNUNET_assert (0 < mq->queue_length);
931 mq->queue_length--; 938 mq->queue_length--;
932 mq->cancel_impl (mq, mq->impl_state); 939 mq->cancel_impl (mq,
940 mq->impl_state);
933 /* continue sending the next message, if any */ 941 /* continue sending the next message, if any */
934 mq->current_envelope = mq->envelope_head; 942 mq->current_envelope = mq->envelope_head;
935 if (NULL != mq->current_envelope) 943 if (NULL != mq->current_envelope)
@@ -941,14 +949,17 @@ GNUNET_MQ_send_cancel (struct GNUNET_MQ_Envelope *ev)
941 LOG (GNUNET_ERROR_TYPE_DEBUG, 949 LOG (GNUNET_ERROR_TYPE_DEBUG,
942 "sending canceled message of type %u queue\n", 950 "sending canceled message of type %u queue\n",
943 ntohs (ev->mh->type)); 951 ntohs (ev->mh->type));
944 952 mq->send_impl (mq,
945 mq->send_impl (mq, mq->current_envelope->mh, mq->impl_state); 953 mq->current_envelope->mh,
954 mq->impl_state);
946 } 955 }
947 } 956 }
948 else 957 else
949 { 958 {
950 /* simple case, message is still waiting in the queue */ 959 /* simple case, message is still waiting in the queue */
951 GNUNET_CONTAINER_DLL_remove (mq->envelope_head, mq->envelope_tail, ev); 960 GNUNET_CONTAINER_DLL_remove (mq->envelope_head,
961 mq->envelope_tail,
962 ev);
952 GNUNET_assert (0 < mq->queue_length); 963 GNUNET_assert (0 < mq->queue_length);
953 mq->queue_length--; 964 mq->queue_length--;
954 } 965 }
@@ -1127,8 +1138,8 @@ GNUNET_MQ_destroy_notify (struct GNUNET_MQ_Handle *mq,
1127 * @param dnh handle for registration to cancel 1138 * @param dnh handle for registration to cancel
1128 */ 1139 */
1129void 1140void
1130GNUNET_MQ_destroy_notify_cancel ( 1141GNUNET_MQ_destroy_notify_cancel (struct
1131 struct GNUNET_MQ_DestroyNotificationHandle *dnh) 1142 GNUNET_MQ_DestroyNotificationHandle *dnh)
1132{ 1143{
1133 struct GNUNET_MQ_Handle *mq = dnh->mq; 1144 struct GNUNET_MQ_Handle *mq = dnh->mq;
1134 1145