Fix serialization
Was putting new data in the front of the message instead of the end. This mismatched with how I was deserializing the messages
This commit is contained in:
@@ -33,15 +33,15 @@ static char *endpoint() {
|
||||
static zmsg_t *command_to_zmsg(struct guestfs_inpsect_command *command) {
|
||||
zmsg_t *res = zmsg_new();
|
||||
|
||||
zmsg_pushstr(res, command->name);
|
||||
zmsg_pushmem(res, &(command->command), sizeof(command->command));
|
||||
zmsg_addstr(res, command->name);
|
||||
zmsg_addmem(res, &(command->command), sizeof(command->command));
|
||||
|
||||
switch (command->command) {
|
||||
case GUESTFS_COMMAND_LS:
|
||||
zmsg_pushmem(res, &(command->args.ls.paths_length), sizeof(command->args.ls.paths_length));
|
||||
zmsg_addmem(res, &(command->args.ls.paths_length), sizeof(command->args.ls.paths_length));
|
||||
|
||||
for (size_t i = 0; i < (command->args.ls.paths_length); i++) {
|
||||
zmsg_pushstr(res, command->args.ls.paths[i]);
|
||||
zmsg_addstr(res, command->args.ls.paths[i]);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user