master
c 21 lines 756 Bytes
Raw
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 #include "commands.h"
4 #include "../stream-sender-internals.h"
5 #include "plugins.d/pluginsd_internals.h"
6
7 void stream_send_global_functions(RRDHOST *host) {
8 if(!stream_has_capability(host->sender, STREAM_CAP_FUNCTIONS))
9 return;
10
11 if(unlikely(!rrdhost_can_stream_metadata_to_parent(host)))
12 return;
13
14 CLEAN_BUFFER *wb = buffer_create(0, NULL);
15
16 stream_sender_send_global_rrdhost_functions(host, wb, stream_has_capability(host->sender, STREAM_CAP_DYNCFG));
17
18 // send it as STREAM_TRAFFIC_TYPE_METADATA, not STREAM_TRAFFIC_TYPE_FUNCTIONS
19 // this is just metadata not an interactive function call
20 sender_commit_clean_buffer(host->sender, wb, STREAM_TRAFFIC_TYPE_METADATA);
21 }