- /* Send command */
- ret = send_command(sock, RELAYD_ADD_STREAM, (void *) &msg, sizeof(msg), 0);
- if (ret < 0) {
- goto error;
+ /* Send command */
+ ret = send_command(rsock, RELAYD_ADD_STREAM, (void *) &msg, sizeof(msg), 0);
+ if (ret < 0) {
+ goto error;
+ }
+ } else {
+ /* Compat with relayd 2.2+ */
+ strncpy(msg_2_2.channel_name, channel_name, sizeof(msg_2_2.channel_name));
+ strncpy(msg_2_2.pathname, pathname, sizeof(msg_2_2.pathname));
+ msg_2_2.tracefile_size = htobe64(tracefile_size);
+ msg_2_2.tracefile_count = htobe64(tracefile_count);
+
+ /* Send command */
+ ret = send_command(rsock, RELAYD_ADD_STREAM, (void *) &msg_2_2, sizeof(msg_2_2), 0);
+ if (ret < 0) {
+ goto error;
+ }