summaryrefslogtreecommitdiffstats
path: root/database/rrdhost.c
diff options
context:
space:
mode:
authorthiagoftsm <thiagoftsm@gmail.com>2020-02-05 20:13:09 +0000
committerGitHub <noreply@github.com>2020-02-05 20:13:08 +0000
commitd9f977b864a8abc2213201817a93a041c30d17b4 (patch)
treeb998fefd6408fb658001ffa4f521beac02fd04df /database/rrdhost.c
parent694b960620f5ea164c9a8dd2a37cd680f9a48fac (diff)
Stream with version (#7851)
* stream_forward: Fix protocol This commit brings the necessary fixes to the protocol * stream_forward: Fix old slave support This commit fixes the communication with old versions of Netdata * stream_forward: Remove declaration There was a wrong declaration inside a block, so I am removing it * stream_forward: USe version This commit brings the use of version instead flags to stream * stream_forward: Remove variable This commit removes useless variable from hand shake * stream_forward: Change message Change the message setting the protocol version on it * stream_forward: Fix version number * stream_forward: readable definition The definition and the variables were using the same data type, but with different declaration, this commit fixes this. * stream_forward: Set master version inside message This commit updates the message used that there was a successfull connection with master * stream_forward: FIx wrong version This commit fixes the multiple set for stream version * stream_forward: Reorganize code This commit reorganizes code to speed up the processing * stream_forward: Adjust code This commit removes an unecessary else * stream_forward: Brings old structure This commits returns a previous necessary to the code * stream_forward: fix error report This commit fixes the error report that was happening when the stream version does not match * stream_forward: Fixes msg and remove unecessary call
Diffstat (limited to 'database/rrdhost.c')
-rw-r--r--database/rrdhost.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/database/rrdhost.c b/database/rrdhost.c
index abbd3193b9..6a11fc9020 100644
--- a/database/rrdhost.c
+++ b/database/rrdhost.c
@@ -147,6 +147,8 @@ RRDHOST *rrdhost_create(const char *hostname,
host->rrdpush_sender_pipe[0] = -1;
host->rrdpush_sender_pipe[1] = -1;
host->rrdpush_sender_socket = -1;
+
+ host->stream_version = STREAMING_PROTOCOL_CURRENT_VERSION;
#ifdef ENABLE_HTTPS
host->ssl.conn = NULL;
host->ssl.flags = NETDATA_SSL_START;
@@ -405,6 +407,7 @@ RRDHOST *rrdhost_find_or_create(
}
else {
host->health_enabled = health_enabled;
+ host->stream_version = STREAMING_PROTOCOL_CURRENT_VERSION;
if(strcmp(host->hostname, hostname) != 0) {
info("Host '%s' has been renamed to '%s'. If this is not intentional it may mean multiple hosts are using the same machine_guid.", host->hostname, hostname);
@@ -1309,7 +1312,9 @@ restart_after_removal:
int rrdhost_set_system_info_variable(struct rrdhost_system_info *system_info, char *name, char *value) {
int res = 0;
- if(!strcmp(name, "NETDATA_CONTAINER_OS_NAME")){
+ if (!strcmp(name, "NETDATA_PROTOCOL_VERSION"))
+ return res;
+ else if(!strcmp(name, "NETDATA_CONTAINER_OS_NAME")){
freez(system_info->container_os_name);
system_info->container_os_name = strdupz(value);
}