X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafb-proto-ws.c;h=3c8922cd3b0e7a0fba1d6684bce64968e1e3e2ac;hb=f11c11123f8cc43fc6e810b6c3dd911eb697826e;hp=24f70e5ef486025e138b98732b7fac29d3284048;hpb=7832d70f259bbb1f40ca5164f2128000519a16fe;p=src%2Fapp-framework-binder.git diff --git a/src/afb-proto-ws.c b/src/afb-proto-ws.c index 24f70e5e..3c8922cd 100644 --- a/src/afb-proto-ws.c +++ b/src/afb-proto-ws.c @@ -33,14 +33,10 @@ #include #include -#include - -#include "afb-common.h" #include "afb-ws.h" #include "afb-msg-json.h" #include "afb-proto-ws.h" -#include "verbose.h" struct afb_proto_ws; @@ -358,7 +354,6 @@ int afb_proto_ws_call_success(struct afb_proto_ws_call *call, struct json_object goto success; } } - ERROR("error while sending success"); success: return rc; } @@ -378,7 +373,6 @@ int afb_proto_ws_call_fail(struct afb_proto_ws_call *call, const char *status, c goto success; } } - ERROR("error while sending fail"); success: return rc; } @@ -422,7 +416,6 @@ int afb_proto_ws_call_subcall(struct afb_proto_ws_call *call, const char *api, c } } } - ERROR("error while sending subcall"); success: return rc; } @@ -442,7 +435,6 @@ int afb_proto_ws_call_subscribe(struct afb_proto_ws_call *call, const char *even goto success; } } - ERROR("error while subscribing event"); success: return rc; } @@ -462,7 +454,6 @@ int afb_proto_ws_call_unsubscribe(struct afb_proto_ws_call *call, const char *ev goto success; } } - ERROR("error while subscribing event"); success: return rc; } @@ -510,14 +501,12 @@ static int client_msg_call_get(struct afb_proto_ws *protows, struct readbuf *rb, /* get event data from the message */ if (!readbuf_uint32(rb, &callid)) { - ERROR("Invalid message"); return 0; } /* get the call */ *call = client_call_search(protows, callid); if (*call == NULL) { - ERROR("message not found"); return 0; } @@ -1098,7 +1087,7 @@ static const struct afb_ws_itf server_ws_itf = /*****************************************************/ -static struct afb_proto_ws *afb_proto_ws_create(int fd, const struct afb_proto_ws_server_itf *itfs, const struct afb_proto_ws_client_itf *itfc, void *closure, const struct afb_ws_itf *itf) +static struct afb_proto_ws *afb_proto_ws_create(struct sd_event *eloop, int fd, const struct afb_proto_ws_server_itf *itfs, const struct afb_proto_ws_client_itf *itfc, void *closure, const struct afb_ws_itf *itf) { struct afb_proto_ws *protows; @@ -1108,7 +1097,7 @@ static struct afb_proto_ws *afb_proto_ws_create(int fd, const struct afb_proto_w else { fcntl(fd, F_SETFD, FD_CLOEXEC); fcntl(fd, F_SETFL, O_NONBLOCK); - protows->ws = afb_ws_create(afb_common_get_event_loop(), fd, itf, protows); + protows->ws = afb_ws_create(eloop, fd, itf, protows); if (protows->ws != NULL) { protows->fd = fd; protows->refcount = 1; @@ -1124,14 +1113,14 @@ static struct afb_proto_ws *afb_proto_ws_create(int fd, const struct afb_proto_w return NULL; } -struct afb_proto_ws *afb_proto_ws_create_client(int fd, const struct afb_proto_ws_client_itf *itf, void *closure) +struct afb_proto_ws *afb_proto_ws_create_client(struct sd_event *eloop, int fd, const struct afb_proto_ws_client_itf *itf, void *closure) { - return afb_proto_ws_create(fd, NULL, itf, closure, &proto_ws_client_ws_itf); + return afb_proto_ws_create(eloop, fd, NULL, itf, closure, &proto_ws_client_ws_itf); } -struct afb_proto_ws *afb_proto_ws_create_server(int fd, const struct afb_proto_ws_server_itf *itf, void *closure) +struct afb_proto_ws *afb_proto_ws_create_server(struct sd_event *eloop, int fd, const struct afb_proto_ws_server_itf *itf, void *closure) { - return afb_proto_ws_create(fd, itf, NULL, closure, &server_ws_itf); + return afb_proto_ws_create(eloop, fd, itf, NULL, closure, &server_ws_itf); } void afb_proto_ws_unref(struct afb_proto_ws *protows)