summaryrefslogtreecommitdiff
path: root/lsp.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2023-01-07 16:09:30 -0500
committerpommicket <pommicket@gmail.com>2023-01-07 16:09:30 -0500
commit66da8ac5dcfe02d3aa79f72ba415235eb872ec1d (patch)
tree651dbbeabf79f70b84f6e1c4394ebd703837737c /lsp.c
parent7640ecce499fc49cad3d9b9f391cce0b74e435c9 (diff)
better request cancellation system
Diffstat (limited to 'lsp.c')
-rw-r--r--lsp.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/lsp.c b/lsp.c
index 34f56ae..e208617 100644
--- a/lsp.c
+++ b/lsp.c
@@ -241,10 +241,10 @@ static bool request_type_is_notification(LSPRequestType type) {
return false;
}
-LSPRequestID lsp_send_request(LSP *lsp, LSPRequest *request) {
+LSPServerRequestID lsp_send_request(LSP *lsp, LSPRequest *request) {
if (!lsp_supports_request(lsp, request)) {
lsp_request_free(request);
- return 0;
+ return (LSPServerRequestID){0};
}
bool is_notification = request_type_is_notification(request->type);
@@ -253,7 +253,10 @@ LSPRequestID lsp_send_request(LSP *lsp, LSPRequest *request) {
LSPMessage message = {.type = LSP_REQUEST};
message.u.request = *request;
lsp_send_message(lsp, &message);
- return request->id;
+ return (LSPServerRequestID) {
+ .lsp = lsp->id,
+ .id = request->id
+ };
}
void lsp_send_response(LSP *lsp, LSPResponse *response) {