X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafb-proto-ws.c;h=3365d60e28f08be7dc4580d278224b30393a59c9;hb=26b09b0df148d1018681ebe5772d3ec1cbd51526;hp=10c06fcde5a9d88c4b9b2b7fa2c7fd09125fe706;hpb=f40979c718fa6fe6b571e133e1bf19fc90957298;p=src%2Fapp-framework-binder.git diff --git a/src/afb-proto-ws.c b/src/afb-proto-ws.c index 10c06fcd..3365d60e 100644 --- a/src/afb-proto-ws.c +++ b/src/afb-proto-ws.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2019 "IoT.bzh" + * Copyright (C) 2015-2020 "IoT.bzh" * Author José Bollo * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -670,11 +670,11 @@ static void client_on_reply(struct afb_proto_ws *protows, struct readbuf *rb) static void client_on_description(struct afb_proto_ws *protows, struct readbuf *rb) { - uint32_t descid; + uint16_t descid; struct client_describe *desc, **prv; struct json_object *object; - if (readbuf_uint32(rb, &descid)) { + if (readbuf_uint16(rb, &descid)) { pthread_mutex_lock(&protows->mutex); prv = &protows->describes; while ((desc = *prv) && desc->descid != descid) @@ -970,13 +970,13 @@ overflow: afb_proto_ws_unref(protows); } -static int server_send_description(struct afb_proto_ws *protows, uint32_t descid, struct json_object *descobj) +static int server_send_description(struct afb_proto_ws *protows, uint16_t descid, struct json_object *descobj) { int rc = -1; struct writebuf wb = { .iovcount = 0, .bufcount = 0 }; if (writebuf_char(&wb, CHAR_FOR_DESCRIPTION) - && writebuf_uint32(&wb, descid) + && writebuf_uint16(&wb, descid) && writebuf_object(&wb, descobj)) rc = proto_write(protows, &wb); return rc;