aboutsummaryrefslogtreecommitdiffstats
path: root/sway/ipc-server.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/ipc-server.c')
-rw-r--r--sway/ipc-server.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/sway/ipc-server.c b/sway/ipc-server.c
index 95433d97..e3d73522 100644
--- a/sway/ipc-server.c
+++ b/sway/ipc-server.c
@@ -668,7 +668,8 @@ void ipc_client_handle_command(struct ipc_client *client) {
668 // TODO: Check if they're permitted to use these events 668 // TODO: Check if they're permitted to use these events
669 struct json_object *request = json_tokener_parse(buf); 669 struct json_object *request = json_tokener_parse(buf);
670 if (request == NULL) { 670 if (request == NULL) {
671 client_valid = ipc_send_reply(client, "{\"success\": false}", 18); 671 const char msg[] = "[{\"success\": false}]";
672 client_valid = ipc_send_reply(client, msg, strlen(msg));
672 wlr_log(WLR_INFO, "Failed to parse subscribe request"); 673 wlr_log(WLR_INFO, "Failed to parse subscribe request");
673 goto exit_cleanup; 674 goto exit_cleanup;
674 } 675 }
@@ -695,8 +696,8 @@ void ipc_client_handle_command(struct ipc_client *client) {
695 client->subscribed_events |= event_mask(IPC_EVENT_TICK); 696 client->subscribed_events |= event_mask(IPC_EVENT_TICK);
696 is_tick = true; 697 is_tick = true;
697 } else { 698 } else {
698 client_valid = 699 const char msg[] = "[{\"success\": false}]";
699 ipc_send_reply(client, "{\"success\": false}", 18); 700 client_valid = ipc_send_reply(client, msg, strlen(msg));
700 json_object_put(request); 701 json_object_put(request);
701 wlr_log(WLR_INFO, "Unsupported event type in subscribe request"); 702 wlr_log(WLR_INFO, "Unsupported event type in subscribe request");
702 goto exit_cleanup; 703 goto exit_cleanup;
@@ -704,10 +705,12 @@ void ipc_client_handle_command(struct ipc_client *client) {
704 } 705 }
705 706
706 json_object_put(request); 707 json_object_put(request);
707 client_valid = ipc_send_reply(client, "{\"success\": true}", 17); 708 const char msg[] = "[{\"success\": true}]";
709 client_valid = ipc_send_reply(client, msg, strlen(msg));
708 if (is_tick) { 710 if (is_tick) {
709 client->current_command = IPC_EVENT_TICK; 711 client->current_command = IPC_EVENT_TICK;
710 ipc_send_reply(client, "{\"first\": true, \"payload\": \"\"}", 30); 712 const char tickmsg[] = "{\"first\": true, \"payload\": \"\"}";
713 ipc_send_reply(client, tickmsg, strlen(tickmsg));
711 } 714 }
712 goto exit_cleanup; 715 goto exit_cleanup;
713 } 716 }