zeromq / ingescape

Model-based framework for broker-free distributed software environments. Any language, any OS, web, cloud.
Other
61 stars 14 forks source link

DATA handling in service args #68

Closed Mathsoum closed 1 year ago

Mathsoum commented 1 year ago

Passing bytes to a service DATA arg seems to send garbage, at least in front of the real DATA. Passing bytearray straight throws an OOM error, event when passing just a few bytes.

It appears that the python wrapper uses the wrong python C-API to pass DATA to igs_service_args_add_data resulting in conversion error or wrong memory block passed to ingescape.

Solution: Check if passed python object is of types bytes or bytearray and use the proper APIs to convert python data object to C char*

NOTE: There is still problems with sending DATA as output. An other PR should follow with corrections about that (related issue #67).