aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/msgpack_rpc/channel.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/msgpack_rpc/channel.c')
-rw-r--r--src/nvim/msgpack_rpc/channel.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/nvim/msgpack_rpc/channel.c b/src/nvim/msgpack_rpc/channel.c
index 5564bfa1be..aa6008558f 100644
--- a/src/nvim/msgpack_rpc/channel.c
+++ b/src/nvim/msgpack_rpc/channel.c
@@ -436,6 +436,11 @@ static void handle_request(Channel *channel, msgpack_object *request)
&error,
NIL,
&out_buffer));
+ char buf[256];
+ snprintf(buf, sizeof(buf),
+ "Channel %" PRIu64 " sent an invalid message, closing.",
+ channel->id);
+ call_set_error(channel, buf);
return;
}
@@ -491,6 +496,10 @@ static bool channel_write(Channel *channel, WBuffer *buffer)
{
bool success;
+ if (channel->closed) {
+ return false;
+ }
+
if (channel->is_job) {
success = job_write(channel->data.job, buffer);
} else {