afb-stub-ws: Always validate clients of stub-ws
[src/app-framework-binder.git] / src / afb-stub-ws.c
index 7637f22..693a0d0 100644 (file)
@@ -33,7 +33,6 @@
 #include <pthread.h>
 
 #include <json-c/json.h>
-#include <systemd/sd-event.h>
 
 #include <afb/afb-event.h>
 
@@ -480,6 +479,7 @@ static void on_call(void *closure, struct afb_proto_ws_call *call, const char *v
        /* init the context */
        if (afb_context_connect(&wreq->xreq.context, sessionid, NULL) < 0)
                goto unconnected;
+       wreq->xreq.context.validated = 1;
 
        /* makes the call */
        wreq->xreq.cred = afb_cred_addref(stubws->cred);
@@ -611,9 +611,9 @@ static struct afb_stub_ws *afb_stub_ws_create(int fd, const char *apiname, struc
                errno = ENOMEM;
        else {
                if (client)
-                       stubws->proto = afb_proto_ws_create_client(fd, &client_itf, stubws);
+                       stubws->proto = afb_proto_ws_create_client(afb_common_get_event_loop(), fd, &client_itf, stubws);
                else
-                       stubws->proto = afb_proto_ws_create_server(fd, &server_itf, stubws);
+                       stubws->proto = afb_proto_ws_create_server(afb_common_get_event_loop(), fd, &server_itf, stubws);
                if (stubws->proto != NULL) {
                        strcpy(stubws->apiname, apiname);
                        stubws->apiset = afb_apiset_addref(apiset);