Skip to content
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

fix misencoding of query body #265

Merged
merged 2 commits into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/protocol/codec/message.c
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ int8_t _z_query_encode(_z_wbuf_t *wbf, const _z_msg_query_t *msg) {
_Z_RETURN_IF_ERR(_z_uint8_encode(wbf, extheader));
_Z_RETURN_IF_ERR(_z_zint_encode(wbf, _z_zint_len(msg->_ext_value.encoding.prefix) +
_z_bytes_encode_len(&msg->_ext_value.encoding.suffix) +
_z_bytes_encode_len(&msg->_ext_value.payload)));
msg->_ext_value.payload.len));
_Z_RETURN_IF_ERR(_z_encoding_prefix_encode(wbf, msg->_ext_value.encoding.prefix));
_Z_RETURN_IF_ERR(_z_bytes_encode(wbf, &msg->_ext_value.encoding.suffix));
_Z_RETURN_IF_ERR(_z_bytes_val_encode(wbf, &msg->_ext_value.payload));
Expand Down
4 changes: 3 additions & 1 deletion tests/z_msgcodec_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,9 @@ _z_bytes_t gen_bytes(size_t len) {
if (len == 0) return arr;

arr.start = (uint8_t *)z_malloc(sizeof(uint8_t) * len);
for (_z_zint_t i = 0; i < len; i++) ((uint8_t *)arr.start)[i] = gen_uint8();
for (_z_zint_t i = 0; i < len; i++) {
((uint8_t *)arr.start)[i] = gen_uint8() & 0b01111111;
}

return arr;
}
Expand Down
6 changes: 3 additions & 3 deletions zenohpico.pc
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
prefix=/var/empty/local
prefix=/usr/local

Name: zenohpico
Description:
URL:
Version: 0.11.20231017dev
Version: 0.11.20231019dev
Cflags: -I${prefix}/include
Libs: -L${prefix}/lib64 -lzenohpico
Libs: -L${prefix}/lib -lzenohpico
Loading