aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api/private/defs.h
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2019-04-12 02:06:49 +0200
committerJustin M. Keyes <justinkz@gmail.com>2019-04-12 02:30:31 +0200
commitfd00806f01673891a4970851612dea1838a39fb9 (patch)
tree47dc0642aaa9b7b25d0f226f29862660ef208205 /src/nvim/api/private/defs.h
parentb4ca56d96dcf0fe14150115a8826206710d0567a (diff)
downloadrneovim-fd00806f01673891a4970851612dea1838a39fb9.tar.gz
rneovim-fd00806f01673891a4970851612dea1838a39fb9.tar.bz2
rneovim-fd00806f01673891a4970851612dea1838a39fb9.zip
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
Diffstat (limited to 'src/nvim/api/private/defs.h')
-rw-r--r--src/nvim/api/private/defs.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/nvim/api/private/defs.h b/src/nvim/api/private/defs.h
index feca140547..978c55691b 100644
--- a/src/nvim/api/private/defs.h
+++ b/src/nvim/api/private/defs.h
@@ -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))