aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_helper_lib.h
diff options
context:
space:
mode:
authorgrothoff <grothoff@140774ce-b5e7-0310-ab8b-a85725594a96>2012-05-08 19:17:03 +0000
committergrothoff <grothoff@140774ce-b5e7-0310-ab8b-a85725594a96>2012-05-08 19:17:03 +0000
commit474442abb283bced287305dc057d85e0da50b5f9 (patch)
tree9d89e4f33b7c60bbd08d2ed85a7d439b963044e6 /src/include/gnunet_helper_lib.h
parent3e5601d61ab036e1bb864f2f29da82525727b0e3 (diff)
-allow helper send to be cancelled
git-svn-id: https://gnunet.org/svn/gnunet@21359 140774ce-b5e7-0310-ab8b-a85725594a96
Diffstat (limited to 'src/include/gnunet_helper_lib.h')
-rw-r--r--src/include/gnunet_helper_lib.h23
1 files changed, 20 insertions, 3 deletions
diff --git a/src/include/gnunet_helper_lib.h b/src/include/gnunet_helper_lib.h
index 7115748fc7..9c1bc21e28 100644
--- a/src/include/gnunet_helper_lib.h
+++ b/src/include/gnunet_helper_lib.h
@@ -75,6 +75,12 @@ typedef void (*GNUNET_HELPER_Continuation)(void *cls,
/**
+ * Handle to cancel 'send'
+ */
+struct GNUNET_HELPER_SendHandle;
+
+
+/**
* Send an message to the helper.
*
* @param h helper to send message to
@@ -82,10 +88,11 @@ typedef void (*GNUNET_HELPER_Continuation)(void *cls,
* @param can_drop can the message be dropped if there is already one in the queue?
* @param cont continuation to run once the message is out
* @param cont_cls closure for 'cont'
- * @return GNUNET_YES if the message will be sent
- * GNUNET_NO if the message was dropped
+ * @return NULL if the message was dropped,
+ * otherwise handle to cancel *cont* (actual transmission may
+ * not be abortable)
*/
-int
+struct GNUNET_HELPER_SendHandle *
GNUNET_HELPER_send (struct GNUNET_HELPER_Handle *h,
const struct GNUNET_MessageHeader *msg,
int can_drop,
@@ -93,4 +100,14 @@ GNUNET_HELPER_send (struct GNUNET_HELPER_Handle *h,
void *cont_cls);
+/**
+ * Cancel a 'send' operation. If possible, transmitting the
+ * message is also aborted, but at least 'cont' won't be
+ * called.
+ *
+ * @param sh operation to cancel
+ */
+void
+GNUNET_HELPER_send_cancel (struct GNUNET_HELPER_SendHandle *sh);
+
#endif /* end of include guard: GNUNET_HELPER_LIB_H */