pod-builder: make more generic builder

Make a vararg based builder that produces much smaller code.
Catch demarshal errors.
Simplify array handling
This commit is contained in:
Wim Taymans 2017-03-07 17:23:35 +01:00
parent f92b68c3c3
commit 78a3cd61b8
9 changed files with 862 additions and 637 deletions

View file

@ -163,9 +163,10 @@ connection_data (SpaSource *source,
continue;
}
demarshal = resource->demarshal;
if (demarshal[opcode])
demarshal[opcode] (resource, message, size);
else
if (demarshal[opcode]) {
if (!demarshal[opcode] (resource, message, size))
pinos_log_error ("protocol-native %p: invalid message received", client->impl);
} else
pinos_log_error ("protocol-native %p: function %d not implemented", client->impl, opcode);
}
}