MEDIUM: connection: make it possible for data->wake to return an error
Just like ->init(), ->wake() may now be used to return an error and
abort the connection. Currently this is not used but will be with
embryonic sessions.
diff --git a/include/types/connection.h b/include/types/connection.h
index 44fdb0d..3219309 100644
--- a/include/types/connection.h
+++ b/include/types/connection.h
@@ -180,12 +180,13 @@
* at the transport layer, which can be a connection opening/close, or any
* data movement. The <init> callback may be called by the connection handler
* at the end of a transport handshake, when it is about to transfer data and
- * the data layer is not ready yet.
+ * the data layer is not ready yet. Both <wake> and <init> may abort a connection
+ * by returning < 0.
*/
struct data_cb {
void (*recv)(struct connection *conn); /* data-layer recv callback */
void (*send)(struct connection *conn); /* data-layer send callback */
- void (*wake)(struct connection *conn); /* data-layer callback to report activity */
+ int (*wake)(struct connection *conn); /* data-layer callback to report activity */
int (*init)(struct connection *conn); /* data-layer initialization */
};