mirror of
https://github.com/neovim/neovim.git
synced 2025-10-09 03:16:31 +00:00
RPC: eliminate NO_RESPONSE
Using a sentinel value in the response-id is ambiguous because the msgpack-rpc spec allows all values (including zero/max). And clients control the id, so we can't be sure they won't use the sentinel value. Instead of a sentinel value, check the message type explicitly. ref #8850
This commit is contained in:
@@ -29,14 +29,13 @@ typedef enum {
|
||||
} ErrorType;
|
||||
|
||||
typedef enum {
|
||||
kMessageTypeRequest,
|
||||
kMessageTypeResponse,
|
||||
kMessageTypeNotification
|
||||
kMessageTypeUnknown = -1,
|
||||
// Per msgpack-rpc spec.
|
||||
kMessageTypeRequest = 0,
|
||||
kMessageTypeResponse = 1,
|
||||
kMessageTypeNotification = 2,
|
||||
} MessageType;
|
||||
|
||||
/// Used as the message ID of notifications.
|
||||
#define NO_RESPONSE UINT64_MAX
|
||||
|
||||
/// Mask for all internal calls
|
||||
#define INTERNAL_CALL_MASK (((uint64_t)1) << (sizeof(uint64_t) * 8 - 1))
|
||||
|
||||
|
Reference in New Issue
Block a user