ipc: also send a reply for COMMAND messages

This commit is contained in:
Michael Stapelberg 2010-03-12 15:29:44 +01:00
parent 5a3d1b38e8
commit d6f726283c
2 changed files with 9 additions and 0 deletions

View File

@ -34,6 +34,9 @@
*
*/
/** Command reply type */
#define I3_IPC_REPLY_TYPE_COMMAND 0
/** Workspaces reply type */
#define I3_IPC_REPLY_TYPE_WORKSPACES 1

View File

@ -181,6 +181,12 @@ static void ipc_handle_message(int fd, uint8_t *message, int size,
parse_command(global_conn, (const char*)command);
free(command);
/* For now, every command gets a positive acknowledge
* (will change with the new command parser) */
const char *reply = "{\"success\":true}";
ipc_send_message(fd, (const unsigned char*)reply,
I3_IPC_REPLY_TYPE_COMMAND, strlen(reply));
break;
}
case I3_IPC_MESSAGE_TYPE_GET_WORKSPACES: