diff options
author | Florian Dold <florian.dold@gmail.com> | 2016-10-16 22:07:40 +0000 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2016-10-16 22:07:40 +0000 |
commit | b368ebf988178ed83775a94b604885aa89e25406 (patch) | |
tree | afc8e92ef333627d708a22e2311db4a343e10dbd /src/include/gnunet_mq_lib.h | |
parent | 903a1d69865a112bc2f5e015aaf4f7c172d39556 (diff) | |
download | gnunet-b368ebf988178ed83775a94b604885aa89e25406.tar.gz gnunet-b368ebf988178ed83775a94b604885aa89e25406.zip |
implement impl_in_flight API for MQ, replacing evacuation
Diffstat (limited to 'src/include/gnunet_mq_lib.h')
-rw-r--r-- | src/include/gnunet_mq_lib.h | 37 |
1 files changed, 11 insertions, 26 deletions
diff --git a/src/include/gnunet_mq_lib.h b/src/include/gnunet_mq_lib.h index 95afb6d75..16f1f531a 100644 --- a/src/include/gnunet_mq_lib.h +++ b/src/include/gnunet_mq_lib.h | |||
@@ -702,6 +702,9 @@ GNUNET_MQ_inject_error (struct GNUNET_MQ_Handle *mq, | |||
702 | 702 | ||
703 | /** | 703 | /** |
704 | * Call the send implementation for the next queued message, if any. | 704 | * Call the send implementation for the next queued message, if any. |
705 | * Calls the send notification for the current message unless | ||
706 | * #GNUNET_MQ_impl_send_in_flight was called for this envelope. | ||
707 | * | ||
705 | * Only useful for implementing message queues, results in undefined | 708 | * Only useful for implementing message queues, results in undefined |
706 | * behavior if not used carefully. | 709 | * behavior if not used carefully. |
707 | * | 710 | * |
@@ -712,35 +715,17 @@ GNUNET_MQ_impl_send_continue (struct GNUNET_MQ_Handle *mq); | |||
712 | 715 | ||
713 | 716 | ||
714 | /** | 717 | /** |
715 | * Get the message that should currently be sent. The returned | 718 | * Call the send notification for the current message, but do not |
716 | * message is only valid until #GNUNET_MQ_impl_send_continue is | 719 | * try to send the message until #gnunet_mq_impl_send_continue |
717 | * called. Fails if there is no current message. Only useful for | 720 | * is called. |
718 | * implementing message queues, results in undefined behavior if not | ||
719 | * used carefully. | ||
720 | * | 721 | * |
721 | * @param mq message queue with the current message, only valid | 722 | * only useful for implementing message queues, results in undefined |
722 | * until #GNUNET_MQ_impl_send_continue() is called | 723 | * behavior if not used carefully. |
723 | * @return message to send, never NULL | ||
724 | */ | ||
725 | const struct GNUNET_MessageHeader * | ||
726 | GNUNET_MQ_impl_current (struct GNUNET_MQ_Handle *mq); | ||
727 | |||
728 | |||
729 | /** | ||
730 | * Get the message that is currently being sent when cancellation of that | ||
731 | * message is requested. The returned buffer must be freed by the caller. | ||
732 | * | ||
733 | * This function may be called at most once in the cancel_impl | ||
734 | * function of a message queue. | ||
735 | * | ||
736 | * Use this function to avoid copying a half-sent message. | ||
737 | * | 724 | * |
738 | * @param mq message queue | 725 | * @param mq message queue to send the next message with |
739 | * @return pointer to store the message being canceled, | ||
740 | * must be freed by the caller | ||
741 | */ | 726 | */ |
742 | struct GNUNET_MessageHeader * | 727 | void |
743 | GNUNET_MQ_impl_cancel_evacuate (struct GNUNET_MQ_Handle *mq); | 728 | GNUNET_MQ_impl_send_in_flight (struct GNUNET_MQ_Handle *mq); |
744 | 729 | ||
745 | 730 | ||
746 | /** | 731 | /** |