-static void client_reply_success(struct afb_stub_ws *stubws, struct readbuf *rb)
-{
- struct client_call *call;
- struct json_object *object;
- const char *info;
- uint32_t flags;
-
- /* retrieve the message data */
- if (!client_msg_call_get(stubws, rb, &call))
- return;
-
- if (readbuf_uint32(rb, &flags)
- && readbuf_string(rb, &info, NULL)
- && readbuf_object(rb, &object)) {
- call->xreq->context.flags = (unsigned)flags;
- afb_xreq_success(call->xreq, object, *info ? info : NULL);
- } else {
- /* failing to have the answer */
- afb_xreq_fail(call->xreq, "error", "ws error");
- }
- client_call_destroy(call);
-}
-
-static void client_reply_fail(struct afb_stub_ws *stubws, struct readbuf *rb)
-{
- struct client_call *call;
- const char *info, *status;
- uint32_t flags;
-
- /* retrieve the message data */
- if (!client_msg_call_get(stubws, rb, &call))
- return;
-
- if (readbuf_uint32(rb, &flags)
- && readbuf_string(rb, &status, NULL)
- && readbuf_string(rb, &info, NULL)) {
- call->xreq->context.flags = (unsigned)flags;
- afb_xreq_fail(call->xreq, status, *info ? info : NULL);
- } else {
- /* failing to have the answer */
- afb_xreq_fail(call->xreq, "error", "ws error");
- }
- client_call_destroy(call);
-}
-
-/* send a subcall reply */
-static void client_send_subcall_reply(struct client_subcall *subcall, int iserror, json_object *object)