From a66d2d15382fb153bfa860c0b3ea7cb9630c8afa Mon Sep 17 00:00:00 2001 From: Thiago de Arruda Date: Thu, 28 Aug 2014 17:01:58 -0300 Subject: msgpack-rpc: Always use arrays when sending events or calls This is required by the msgpack-RPC specification. Also, the send_call/send_event functions were refactored to accept a variable number of arguments --- src/nvim/os/msgpack_rpc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/nvim/os/msgpack_rpc.c') diff --git a/src/nvim/os/msgpack_rpc.c b/src/nvim/os/msgpack_rpc.c index 90673fef13..c6e2af2f1c 100644 --- a/src/nvim/os/msgpack_rpc.c +++ b/src/nvim/os/msgpack_rpc.c @@ -118,7 +118,7 @@ void msgpack_rpc_error(char *msg, msgpack_packer *res) /// Serializes a msgpack-rpc request or notification(id == 0) WBuffer *serialize_request(uint64_t request_id, String method, - Object arg, + Array args, msgpack_sbuffer *sbuffer, size_t refcount) FUNC_ATTR_NONNULL_ARG(4) @@ -134,12 +134,12 @@ WBuffer *serialize_request(uint64_t request_id, msgpack_pack_raw(&pac, method.size); msgpack_pack_raw_body(&pac, method.data, method.size); - msgpack_rpc_from_object(arg, &pac); + msgpack_rpc_from_array(args, &pac); WBuffer *rv = wstream_new_buffer(xmemdup(sbuffer->data, sbuffer->size), sbuffer->size, refcount, free); - msgpack_rpc_free_object(arg); + msgpack_rpc_free_array(args); msgpack_sbuffer_clear(sbuffer); return rv; } -- cgit