summaryrefslogtreecommitdiffstats
path: root/src/rest.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/rest.c')
-rw-r--r--src/rest.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/rest.c b/src/rest.c
index 81c3dd9..d415f0f 100644
--- a/src/rest.c
+++ b/src/rest.c
@@ -3325,6 +3325,8 @@ static json_t *og_json_image_alloc(struct og_image *image)
json_integer(image->repo_id));
json_object_set_new(image_json, "description",
json_string(image->description));
+ json_object_set_new(image_json, "checksum",
+ json_string(image->checksum));
return image_json;
}
@@ -3366,7 +3368,7 @@ static int og_cmd_images(char *buffer_reply)
" i.lastupdate, i.permissions, "
" i.idperfilsoft, i.tipo, "
" i.idimagen, i.idrepositorio, "
- " i.descripcion "
+ " i.descripcion, i.checksum "
"FROM imagenes i "
"LEFT JOIN ordenadores o "
"ON i.idordenador = o.idordenador ");
@@ -3381,10 +3383,14 @@ static int og_cmd_images(char *buffer_reply)
image.type = dbi_result_get_ulonglong(result, "tipo");
image.id = dbi_result_get_ulonglong(result, "idimagen");
image.repo_id = dbi_result_get_ulonglong(result, "idrepositorio");
+ snprintf(image.checksum, sizeof(image.checksum), "%s",
+ dbi_result_get_string(result, "checksum"));
snprintf(image.name, sizeof(image.name), "%s",
dbi_result_get_string(result, "nombreca"));
snprintf(image.description, sizeof(image.description), "%s",
dbi_result_get_string(result, "descripcion"));
+ snprintf(image.checksum, sizeof(image.checksum), "%s",
+ dbi_result_get_string(result, "checksum"));
image_json = og_json_image_alloc(&image);
if (!image_json) {