Skip to content

Commit 4ad9759

Browse files
Bug fix in RPC Client request payload (#19)
The payload is not being passed from client to server, this change fixes the bug.
1 parent 07bb047 commit 4ad9759

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

lib/src/zenohRpcClient.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,12 @@ std::future<UPayload> ZenohRpcClient::invokeMethod(const UUri &uri,
154154
opts.timeout_ms = requestTimeoutMs_;
155155
opts.attachment = z_bytes_map_as_attachment(&map);
156156

157-
if ((0 != payload.size()) && (nullptr == payload.data())) {
157+
if ((0 != payload.size()) && (nullptr != payload.data())) {
158158
opts.value.payload.len = payload.size();
159159
opts.value.payload.start = payload.data();
160+
} else {
161+
opts.value.payload.len = 0;
162+
opts.value.payload.start = nullptr;
160163
}
161164

162165
z_bytes_map_insert_by_alias(&map, z_bytes_new("header"), bytes);

0 commit comments

Comments
 (0)