summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Sirgo Rica <asirgo@soleta.eu>2024-05-24 14:17:03 +0200
committerAlejandro Sirgo Rica <asirgo@soleta.eu>2024-05-30 11:31:42 +0200
commit51f275a867b4a7007ea6e2aa93f350f08be2680e (patch)
tree2c6249f3c2a86bab3d1f6e3fea45864fd5770e43
parent111f077d17737ffa7367a7a4af7b32336d15e05e (diff)
client: update cache after image/restorev1.2.5-11
Update the database with the new cache contents sent by the client after an image/restore operation. Resquest response structure: { ... 'cache': [ {'name': 'windows.img', 'size': 2432370213, checksum: '5d4dcc677bc19f40a647d0002f4ade90'}, {'name': 'linux.img', 'size': 243234534213, checksum: '3eb22f888f88a55ad954f55644e1192e'} ] ... } Parse the contents of the 'cache' field to update the data of the client's cache in the database. This is one of the required changes the make cache/list coherent and prevent cache desync between the server and clients.
-rw-r--r--src/client.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/client.c b/src/client.c
index 1486034..9989462 100644
--- a/src/client.c
+++ b/src/client.c
@@ -1065,6 +1065,8 @@ int og_agent_state_process_response(struct og_client *cli)
break;
case OG_CMD_IMAGE_RESTORE:
err = og_resp_image_restore(root, cli);
+ if (!err)
+ err = og_resp_update_cache(root, cli);
break;
case OG_CMD_CACHE_DELETE:
err = og_resp_update_cache(root, cli);