Serialize struct from the client

This commit is contained in:
2024-03-03 16:09:58 -05:00
parent a4b56107aa
commit 16e95af02a
2 changed files with 22 additions and 9 deletions

View File

@@ -105,8 +105,7 @@ static void *worker_task(zsock_t *pipe, char *disk_path) {
printf("Received a message in the worker\n");
printf("Size: %zu\tContent size: %zu\n", zmsg_size(msg), zmsg_content_size(msg));
struct guestfs_inpsect_command *command = malloc(80);
memcpy(command, zmsg_last(msg), 80);
struct guestfs_inpsect_command *command = zmsg_to_command(msg);
printf("Name: %s\n", command->name);
free(command);