X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Frelayd%2Frelayd.cpp;fp=src%2Fcommon%2Frelayd%2Frelayd.cpp;h=e012d25401134cc9a40808ffc34360cb1770b99f;hp=f2a19050574667d05c5f00a07542453ec2e416c2;hb=6d15ee456b72efc4dac58666427d203d285f90f8;hpb=f3742004e5c28961b6b317b01bdaeea4ebaaca0d diff --git a/src/common/relayd/relayd.cpp b/src/common/relayd/relayd.cpp index f2a190505..e012d2540 100644 --- a/src/common/relayd/relayd.cpp +++ b/src/common/relayd/relayd.cpp @@ -1212,16 +1212,16 @@ int relayd_rotate_streams(struct lttcomm_relayd_sock *sock, unsigned int i; struct lttng_dynamic_buffer payload; struct lttcomm_relayd_generic_reply reply = {}; - const struct lttcomm_relayd_rotate_streams msg = { - .stream_count = htobe32((uint32_t) stream_count), - .new_chunk_id = (typeof(msg.new_chunk_id)) { - .is_set = !!new_chunk_id, - .value = htobe64(new_chunk_id ? *new_chunk_id : 0), - }, - }; + struct lttcomm_relayd_rotate_streams msg; char new_chunk_id_buf[MAX_INT_DEC_LEN(*new_chunk_id)] = {}; const char *new_chunk_id_str; + msg.stream_count = htobe32((uint32_t) stream_count); + msg.new_chunk_id = (typeof(msg.new_chunk_id)){ + .is_set = !!new_chunk_id, + .value = htobe64(new_chunk_id ? *new_chunk_id : 0), + }; + if (!relayd_supports_chunks(sock)) { DBG("Refusing to rotate remote streams: relayd does not support chunks"); return 0;