Skip to content

Commit

Permalink
Merge pull request #3218 from johnae/master
Browse files Browse the repository at this point in the history
Fix json object ipc success return
  • Loading branch information
RedSoxFan authored Nov 29, 2018
2 parents 9d18d81 + aef5215 commit cf1793b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sway/ipc-server.c
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ void ipc_client_handle_command(struct ipc_client *client) {
// TODO: Check if they're permitted to use these events
struct json_object *request = json_tokener_parse(buf);
if (request == NULL) {
const char msg[] = "[{\"success\": false}]";
const char msg[] = "{\"success\": false}";
client_valid = ipc_send_reply(client, msg, strlen(msg));
wlr_log(WLR_INFO, "Failed to parse subscribe request");
goto exit_cleanup;
Expand Down Expand Up @@ -696,7 +696,7 @@ void ipc_client_handle_command(struct ipc_client *client) {
client->subscribed_events |= event_mask(IPC_EVENT_TICK);
is_tick = true;
} else {
const char msg[] = "[{\"success\": false}]";
const char msg[] = "{\"success\": false}";
client_valid = ipc_send_reply(client, msg, strlen(msg));
json_object_put(request);
wlr_log(WLR_INFO, "Unsupported event type in subscribe request");
Expand All @@ -705,7 +705,7 @@ void ipc_client_handle_command(struct ipc_client *client) {
}

json_object_put(request);
const char msg[] = "[{\"success\": true}]";
const char msg[] = "{\"success\": true}";
client_valid = ipc_send_reply(client, msg, strlen(msg));
if (is_tick) {
client->current_command = IPC_EVENT_TICK;
Expand Down

0 comments on commit cf1793b

Please sign in to comment.