diff options
author | Brian Ashworth <RedSoxFan@users.noreply.github.com> | 2018-11-29 02:37:27 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-29 02:37:27 -0500 |
commit | cf1793b4f1279d9e4f0453ebaf2433eadc8af51e (patch) | |
tree | 79fb4193756230faa69159333abbedbf72854af1 | |
parent | Merge pull request #3216 from RedSoxFan/fix-empty-titlebars (diff) | |
parent | Fix json object ipc return (diff) | |
download | sway-cf1793b4f1279d9e4f0453ebaf2433eadc8af51e.tar.gz sway-cf1793b4f1279d9e4f0453ebaf2433eadc8af51e.tar.zst sway-cf1793b4f1279d9e4f0453ebaf2433eadc8af51e.zip |
Merge pull request #3218 from johnae/master
Fix json object ipc success return
-rw-r--r-- | sway/ipc-server.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sway/ipc-server.c b/sway/ipc-server.c index e3d73522..b3954259 100644 --- a/sway/ipc-server.c +++ b/sway/ipc-server.c | |||
@@ -668,7 +668,7 @@ 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 | const char msg[] = "[{\"success\": false}]"; | 671 | const char msg[] = "{\"success\": false}"; |
672 | client_valid = ipc_send_reply(client, msg, strlen(msg)); | 672 | client_valid = ipc_send_reply(client, msg, strlen(msg)); |
673 | wlr_log(WLR_INFO, "Failed to parse subscribe request"); | 673 | wlr_log(WLR_INFO, "Failed to parse subscribe request"); |
674 | goto exit_cleanup; | 674 | goto exit_cleanup; |
@@ -696,7 +696,7 @@ void ipc_client_handle_command(struct ipc_client *client) { | |||
696 | client->subscribed_events |= event_mask(IPC_EVENT_TICK); | 696 | client->subscribed_events |= event_mask(IPC_EVENT_TICK); |
697 | is_tick = true; | 697 | is_tick = true; |
698 | } else { | 698 | } else { |
699 | const char msg[] = "[{\"success\": false}]"; | 699 | const char msg[] = "{\"success\": false}"; |
700 | client_valid = ipc_send_reply(client, msg, strlen(msg)); | 700 | client_valid = ipc_send_reply(client, msg, strlen(msg)); |
701 | json_object_put(request); | 701 | json_object_put(request); |
702 | wlr_log(WLR_INFO, "Unsupported event type in subscribe request"); | 702 | wlr_log(WLR_INFO, "Unsupported event type in subscribe request"); |
@@ -705,7 +705,7 @@ void ipc_client_handle_command(struct ipc_client *client) { | |||
705 | } | 705 | } |
706 | 706 | ||
707 | json_object_put(request); | 707 | json_object_put(request); |
708 | const char msg[] = "[{\"success\": true}]"; | 708 | const char msg[] = "{\"success\": true}"; |
709 | client_valid = ipc_send_reply(client, msg, strlen(msg)); | 709 | client_valid = ipc_send_reply(client, msg, strlen(msg)); |
710 | if (is_tick) { | 710 | if (is_tick) { |
711 | client->current_command = IPC_EVENT_TICK; | 711 | client->current_command = IPC_EVENT_TICK; |