diff options
author | Thiago de Arruda <tpadilha84@gmail.com> | 2014-09-03 14:26:16 -0300 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2014-09-12 13:25:28 -0300 |
commit | 74aff19691aeea83fa23265719668467db2b049c (patch) | |
tree | 9d364a6c637366ecb398eccdc8376e554bf15306 /src/nvim/os/msgpack_rpc.c | |
parent | c39ae3e4d475c868f8ba76116735501ea97dfae1 (diff) | |
download | rneovim-74aff19691aeea83fa23265719668467db2b049c.tar.gz rneovim-74aff19691aeea83fa23265719668467db2b049c.tar.bz2 rneovim-74aff19691aeea83fa23265719668467db2b049c.zip |
msgpack-rpc: Refactor initializer and dispatcher
Use Map(String, rpc_method_handler_fn) for storing/retrieving rpc method
handlers in msgpack_rpc_init and msgpack_rpc_dispatch.
Also refactor serialization/validation functions in the
msgpack_rpc.c/msgpack_rpc_helpers.c modules to accept the new STR and BIN types.
Diffstat (limited to 'src/nvim/os/msgpack_rpc.c')
-rw-r--r-- | src/nvim/os/msgpack_rpc.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/nvim/os/msgpack_rpc.c b/src/nvim/os/msgpack_rpc.c index 38670e0bf8..cf32736e16 100644 --- a/src/nvim/os/msgpack_rpc.c +++ b/src/nvim/os/msgpack_rpc.c @@ -235,7 +235,8 @@ static char *msgpack_rpc_validate(uint64_t *response_id, msgpack_object *req) } if (req->via.array.ptr[2].type != MSGPACK_OBJECT_POSITIVE_INTEGER - && req->via.array.ptr[2].type != MSGPACK_OBJECT_BIN) { + && req->via.array.ptr[2].type != MSGPACK_OBJECT_BIN + && req->via.array.ptr[2].type != MSGPACK_OBJECT_STR) { return "Method must be a positive integer or a string"; } |