diff options
author | OpenGnSys Support Team <soporte-og@soleta.eu> | 2024-10-31 00:27:57 +0100 |
---|---|---|
committer | OpenGnSys Support Team <soporte-og@soleta.eu> | 2024-10-31 01:18:57 +0100 |
commit | 479998d76f805c02e041adb209857d4ca6b3f87f (patch) | |
tree | a4f6fb7eaba79bea741f5784616fef19494c9d70 /src/rest.h | |
parent | 83b1be65897095cdc51b427ba3e42ae3d8756f32 (diff) |
src: add last client command context and use it for image creation
Add last client command context that is used in the request to client.
This allows to remove the stub image entry in the database in case that the
image creation fails.
Diffstat (limited to 'src/rest.h')
-rw-r--r-- | src/rest.h | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -51,6 +51,14 @@ enum og_cmd_result { OG_SUCCESS = 2, }; +struct og_cmd_ctx { + union { + struct { + uint32_t id; + } image; + }; +}; + #define OG_MSG_REQUEST_MAXLEN 131072 struct og_client { @@ -70,6 +78,7 @@ struct og_client { enum og_cmd_type type; unsigned int id; enum og_cmd_result result; + struct og_cmd_ctx ctx; } last_cmd; uint32_t speed; uint32_t seq; @@ -159,7 +168,7 @@ enum og_rest_method { int og_send_request(enum og_rest_method method, enum og_cmd_type type, const struct og_msg_params *params, - const json_t *data); + const json_t *data, const struct og_cmd_ctx *ctx); int og_dbi_scope_get(struct og_dbi *dbi, json_t *array); |