diff options
-rw-r--r-- | src/client.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/client.c b/src/client.c index b634251..cdc7b6b 100644 --- a/src/client.c +++ b/src/client.c @@ -1330,6 +1330,12 @@ static int og_clear_image_placeholder() return 0; } +static void og_client_reset_cmd(struct og_client *cli) +{ + cli->last_cmd.id = 0; + cli->last_cmd.type = OG_CMD_UNSPEC; +} + int og_agent_state_process_response(struct og_client *cli) { enum og_cmd_type cmd_type = cli->last_cmd.type; @@ -1392,8 +1398,7 @@ int og_agent_state_process_response(struct og_client *cli) } if (!cli->content_length) { - cli->last_cmd.id = 0; - cli->last_cmd.type = OG_CMD_UNSPEC; + og_client_reset_cmd(cli); return 0; } @@ -1456,8 +1461,7 @@ int og_agent_state_process_response(struct og_client *cli) /* ... cancel pending actions related to this task for this client here */ } - cli->last_cmd.id = 0; - cli->last_cmd.type = OG_CMD_UNSPEC; + og_client_reset_cmd(cli); return err; } |