From 19bc29ee834516ff76944741b25fe158d2282b15 Mon Sep 17 00:00:00 2001 From: Thiago de Arruda Date: Wed, 3 Sep 2014 14:55:55 -0300 Subject: msgpack-rpc: Move handle_missing_method to msgpack_rpc.c Since that function is not automatically generated, it's best to place it in a normal C module --- src/nvim/os/msgpack_rpc.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src') diff --git a/src/nvim/os/msgpack_rpc.c b/src/nvim/os/msgpack_rpc.c index cf32736e16..4a586e8e01 100644 --- a/src/nvim/os/msgpack_rpc.c +++ b/src/nvim/os/msgpack_rpc.c @@ -115,6 +115,16 @@ void msgpack_rpc_error(char *msg, msgpack_packer *res) msgpack_pack_nil(res); } +/// Handler executed when an invalid method name is passed +Object msgpack_rpc_handle_missing_method(uint64_t channel_id, + msgpack_object *req, + Error *error) +{ + snprintf(error->msg, sizeof(error->msg), "Invalid method name"); + error->set = true; + return NIL; +} + /// Serializes a msgpack-rpc request or notification(id == 0) WBuffer *serialize_request(uint64_t request_id, String method, -- cgit