diff options
author | OpenGnSys Support Team <soporte-og@soleta.eu> | 2024-10-31 00:34:38 +0100 |
---|---|---|
committer | OpenGnSys Support Team <soporte-og@soleta.eu> | 2024-10-31 00:39:43 +0100 |
commit | 83b1be65897095cdc51b427ba3e42ae3d8756f32 (patch) | |
tree | c12e903c24559b390c0f85b8707c0f4577ebae83 /src | |
parent | 16cc22df3eec0acca53df3178be22f862bf9fa99 (diff) |
client: add helper function to reset last client command information
just a preparation, no functional changes are intended.
Diffstat (limited to 'src')
-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; } |