Skip to content

Commit

Permalink
Merge pull request #265 from eclipse-zenoh/encoding-fixes
Browse files Browse the repository at this point in the history
fix misencoding of query body
  • Loading branch information
p-avital authored Oct 19, 2023
2 parents 5fff227 + 5a90c01 commit 3da1a0f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
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

0 comments on commit 3da1a0f

Please sign in to comment.