aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_helper_lib.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-05-08 19:17:03 +0000
committerChristian Grothoff <christian@grothoff.org>2012-05-08 19:17:03 +0000
commit6623d76dcb3659204935e462a8d0d415c7748a99 (patch)
tree9d89e4f33b7c60bbd08d2ed85a7d439b963044e6 /src/include/gnunet_helper_lib.h
parent31adadd3c4ca45d147392d6fa5ee839be1037740 (diff)
downloadgnunet-6623d76dcb3659204935e462a8d0d415c7748a99.tar.gz
gnunet-6623d76dcb3659204935e462a8d0d415c7748a99.zip
-allow helper send to be cancelled
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 7115748fc..9c1bc21e2 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,
75 75
76 76
77/** 77/**
78 * Handle to cancel 'send'
79 */
80struct GNUNET_HELPER_SendHandle;
81
82
83/**
78 * Send an message to the helper. 84 * Send an message to the helper.
79 * 85 *
80 * @param h helper to send message to 86 * @param h helper to send message to
@@ -82,10 +88,11 @@ typedef void (*GNUNET_HELPER_Continuation)(void *cls,
82 * @param can_drop can the message be dropped if there is already one in the queue? 88 * @param can_drop can the message be dropped if there is already one in the queue?
83 * @param cont continuation to run once the message is out 89 * @param cont continuation to run once the message is out
84 * @param cont_cls closure for 'cont' 90 * @param cont_cls closure for 'cont'
85 * @return GNUNET_YES if the message will be sent 91 * @return NULL if the message was dropped,
86 * GNUNET_NO if the message was dropped 92 * otherwise handle to cancel *cont* (actual transmission may
93 * not be abortable)
87 */ 94 */
88int 95struct GNUNET_HELPER_SendHandle *
89GNUNET_HELPER_send (struct GNUNET_HELPER_Handle *h, 96GNUNET_HELPER_send (struct GNUNET_HELPER_Handle *h,
90 const struct GNUNET_MessageHeader *msg, 97 const struct GNUNET_MessageHeader *msg,
91 int can_drop, 98 int can_drop,
@@ -93,4 +100,14 @@ GNUNET_HELPER_send (struct GNUNET_HELPER_Handle *h,
93 void *cont_cls); 100 void *cont_cls);
94 101
95 102
103/**
104 * Cancel a 'send' operation. If possible, transmitting the
105 * message is also aborted, but at least 'cont' won't be
106 * called.
107 *
108 * @param sh operation to cancel
109 */
110void
111GNUNET_HELPER_send_cancel (struct GNUNET_HELPER_SendHandle *sh);
112
96#endif /* end of include guard: GNUNET_HELPER_LIB_H */ 113#endif /* end of include guard: GNUNET_HELPER_LIB_H */