summaryrefslogtreecommitdiffstats
path: root/src/client.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/client.c')
-rw-r--r--src/client.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/client.c b/src/client.c
index d1288c4..b634251 100644
--- a/src/client.c
+++ b/src/client.c
@@ -1332,7 +1332,7 @@ static int og_clear_image_placeholder()
int og_agent_state_process_response(struct og_client *cli)
{
- enum og_cmd_type cmd_type = cli->last_cmd;
+ enum og_cmd_type cmd_type = cli->last_cmd.type;
int ret, err = -1, code;
json_error_t json_err;
bool success;
@@ -1359,7 +1359,7 @@ int og_agent_state_process_response(struct og_client *cli)
case 500:
ret = 0;
success = false;
- cli->last_cmd = OG_CMD_UNSPEC;
+ cli->last_cmd.type = OG_CMD_UNSPEC;
syslog(LOG_ERR, "Client %s:%hu reports failure to process command\n",
inet_ntoa(cli->addr.sin_addr), ntohs(cli->addr.sin_port));
/* ... cancel pending actions related to this task for this client here */
@@ -1379,21 +1379,21 @@ int og_agent_state_process_response(struct og_client *cli)
}
if (success)
- cli->last_cmd_result = OG_SUCCESS;
+ cli->last_cmd.result = OG_SUCCESS;
else
- cli->last_cmd_result = OG_FAILURE;
+ cli->last_cmd.result = OG_FAILURE;
if (!success && cmd_type == OG_CMD_IMAGE_CREATE)
og_clear_image_placeholder();
if (code != 200 && code != 103) {
- cli->last_cmd_id = 0;
+ cli->last_cmd.id = 0;
return ret;
}
if (!cli->content_length) {
- cli->last_cmd_id = 0;
- cli->last_cmd = OG_CMD_UNSPEC;
+ cli->last_cmd.id = 0;
+ cli->last_cmd.type = OG_CMD_UNSPEC;
return 0;
}
@@ -1412,7 +1412,7 @@ int og_agent_state_process_response(struct og_client *cli)
return err;
}
- switch (cli->last_cmd) {
+ switch (cli->last_cmd.type) {
case OG_CMD_SHELL_RUN:
err = og_resp_shell_run(cli, root);
break;
@@ -1452,12 +1452,12 @@ int og_agent_state_process_response(struct og_client *cli)
if (err < 0) {
err = 0;
success = false;
- cli->last_cmd_result = OG_FAILURE;
+ cli->last_cmd.result = OG_FAILURE;
/* ... cancel pending actions related to this task for this client here */
}
- cli->last_cmd_id = 0;
- cli->last_cmd = OG_CMD_UNSPEC;
+ cli->last_cmd.id = 0;
+ cli->last_cmd.type = OG_CMD_UNSPEC;
return err;
}