-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update encoding format on the wire #399
Update encoding format on the wire #399
Conversation
@Mallets could you review this PR? |
src/protocol/codec.c
Outdated
} | ||
|
||
int8_t _z_encoding_encode(_z_wbuf_t *wbf, const _z_encoding_t *en) { | ||
_Bool has_suffix = _z_bytes_check(en->suffix); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For naming alignment, it should be called has_schema
and en->schema
.
tests/z_msgcodec_test.c
Outdated
val.encoding.prefix = gen_zint(); | ||
_z_encoding_t gen_encoding(void) { | ||
_z_encoding_t en; | ||
en.prefix = gen_uint32() & 0x7fffffff; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefix should be represented as an uint16_t
.
Definition of typedef struct {
_z_bytes_t suffix;
z_encoding_prefix_t prefix;
} _z_encoding_t; It should become: typedef struct {
_z_bytes_t schema;
uint16_t id;
} _z_encoding_t;
|
The way
encoding_t
prefix is sent on the wire changed to be 31bits + suffix flag. Suffix is only written when present.Because of misalignment on interest format with Zenoh, interests are deactivated by default for now.
In addition, MSVC warning
C4127: conditional statement is constant
, has been disabled as it caused Windows build to fail following the addition of pull subscriber handlers.