mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
channel: Remove code for automatically closing in channel_send_call
This was causing a segfault(reported in #1125) because channels are already closed by `parse_msgpack` when the connection ends. Also fix the RPC stack overflow error message
This commit is contained in:
parent
df64c0f932
commit
51438d8e14
@ -194,8 +194,7 @@ bool channel_send_call(uint64_t id,
|
|||||||
char buf[256];
|
char buf[256];
|
||||||
snprintf(buf,
|
snprintf(buf,
|
||||||
sizeof(buf),
|
sizeof(buf),
|
||||||
"Channel %" PRIu64 " was closed due to a high stack depth "
|
"Channel %" PRIu64 " crossed maximum stack depth",
|
||||||
"while processing a RPC call",
|
|
||||||
channel->id);
|
channel->id);
|
||||||
*result = STRING_OBJ(cstr_to_string(buf));
|
*result = STRING_OBJ(cstr_to_string(buf));
|
||||||
msgpack_rpc_free_array(args);
|
msgpack_rpc_free_array(args);
|
||||||
@ -223,14 +222,6 @@ bool channel_send_call(uint64_t id,
|
|||||||
channel->enabled && // the channel is still enabled
|
channel->enabled && // the channel is still enabled
|
||||||
kv_size(channel->call_stack) >= size); // the call didn't return
|
kv_size(channel->call_stack) >= size); // the call didn't return
|
||||||
|
|
||||||
if (!(kv_size(channel->call_stack)
|
|
||||||
|| channel->enabled
|
|
||||||
|| channel->rpc_call_level)) {
|
|
||||||
// Close the channel if it has been disabled and we have not been called
|
|
||||||
// by `parse_msgpack`(It would be unsafe to close the channel otherwise)
|
|
||||||
close_channel(channel);
|
|
||||||
}
|
|
||||||
|
|
||||||
*errored = frame.errored;
|
*errored = frame.errored;
|
||||||
*result = frame.result;
|
*result = frame.result;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user