uint8_t is_client;
/* the api name */
- char apiname[1];
+ char apiname[];
};
static struct afb_proto_ws *afb_stub_ws_create_proto(struct afb_stub_ws *stubws, struct fdev *fdev, uint8_t server);
json_object_put(object);
}
-static void server_event_broadcast_cb(void *closure, const char *event, int eventid, struct json_object *object)
+static void server_event_broadcast_cb(void *closure, const char *event, struct json_object *object, const uuid_binary_t uuid, uint8_t hop)
{
struct afb_stub_ws *stubws = closure;
if (stubws->proto != NULL)
- afb_proto_ws_server_event_broadcast(stubws->proto, event, object);
+ afb_proto_ws_server_event_broadcast(stubws->proto, event, object, uuid, hop);
json_object_put(object);
}
ERROR("unreadable push event");
}
-static void client_on_event_broadcast_cb(void *closure, const char *event_name, struct json_object *data)
+static void client_on_event_broadcast_cb(void *closure, const char *event_name, struct json_object *data, const uuid_binary_t uuid, uint8_t hop)
{
- afb_evt_broadcast(event_name, data);
+ afb_evt_rebroadcast(event_name, data, uuid, hop);
}
/*****************************************************/
static int enqueue_processing(struct afb_proto_ws *proto, void (*callback)(int signum, void* arg), void *arg)
{
- return jobs_queue(NULL /* proto */, 0, callback, arg);
+ return jobs_queue(proto, 0, callback, arg);
}
/*****************************************************/
{
struct afb_stub_ws *stubws;
- stubws = calloc(1, sizeof *stubws + strlen(apiname));
+ stubws = calloc(1, sizeof *stubws + 1 + strlen(apiname));
if (stubws == NULL)
errno = ENOMEM;
else {