- else
- afb_xreq_reply(xreq, NULL, "internal", "can't send message");
-}
-
-static void client_on_description_cb(void *closure, struct json_object *data)
-{
- struct client_describe *desc = closure;
-
- desc->result = data;
- jobs_leave(desc->jobloop);
-}
-
-static void client_send_describe_cb(int signum, void *closure, struct jobloop *jobloop)
-{
- struct client_describe *desc = closure;
- struct afb_proto_ws *proto;
-
- proto = client_get_proto(desc->stubws);
- if (signum || proto == NULL)
- jobs_leave(jobloop);
- else {
- desc->jobloop = jobloop;
- afb_proto_ws_client_describe(proto, client_on_description_cb, desc);
+ rc = afb_proto_ws_client_call(
+ proto,
+ xreq->request.called_verb,
+ afb_xreq_json(xreq),
+ sessionid,
+ tokenid,
+ xreq,
+ xreq_on_behalf_cred_export(xreq));
+ }
+ if (rc < 0) {
+ afb_xreq_reply(xreq, NULL, afb_error_text_internal_error, "can't send message");
+ afb_xreq_unhooked_unref(xreq);