summaryrefslogtreecommitdiffstats
path: root/streaming
diff options
context:
space:
mode:
authorStelios Fragkakis <52996999+stelfrag@users.noreply.github.com>2023-06-09 15:15:39 +0300
committerGitHub <noreply@github.com>2023-06-09 15:15:39 +0300
commit4d0f2b5ef322e3da3a0182acb47780f002fbd4cc (patch)
tree195573d3ff38e12a4e0d0cf94125cc42ae6f9956 /streaming
parentf34df65da3fbad346833c924186d2aad5e025248 (diff)
Fix coverity issues (#15169)
* online is true at this point * ignore return value * Check sender existence
Diffstat (limited to 'streaming')
-rw-r--r--streaming/receiver.c2
-rw-r--r--streaming/sender.c5
2 files changed, 3 insertions, 4 deletions
diff --git a/streaming/receiver.c b/streaming/receiver.c
index a89fdf04a3..709f15bd58 100644
--- a/streaming/receiver.c
+++ b/streaming/receiver.c
@@ -600,7 +600,7 @@ bool stop_streaming_receiver(RRDHOST *host, const char *reason) {
}
static void rrdpush_send_error_on_taken_over_connection(struct receiver_state *rpt, const char *msg) {
- send_timeout(
+ (void) send_timeout(
#ifdef ENABLE_HTTPS
&rpt->ssl,
#endif
diff --git a/streaming/sender.c b/streaming/sender.c
index b207039b5e..bcdc4f373d 100644
--- a/streaming/sender.c
+++ b/streaming/sender.c
@@ -1101,7 +1101,7 @@ void rrdpush_signal_sender_to_wake_up(struct sender_state *s) {
static NETDATA_DOUBLE rrdhost_sender_replication_completion(RRDHOST *host, time_t now, size_t *instances) {
size_t charts = rrdhost_sender_replicating_charts(host);
NETDATA_DOUBLE completion;
- if(!charts || !host->sender->replication.oldest_request_after_t)
+ if(!charts || !host->sender || !host->sender->replication.oldest_request_after_t)
completion = 100.0;
else if(!host->sender->replication.latest_completed_before_t || host->sender->replication.latest_completed_before_t < host->sender->replication.oldest_request_after_t)
completion = 0.0;
@@ -1159,8 +1159,7 @@ void rrdhost_sender_to_json(BUFFER *wb, RRDHOST *host, const char *key, time_t n
snprintfz(buf, 1024, "[%s]:%d%s", peers.peer.ip, peers.peer.port, ssl ? ":SSL" : "");
buffer_json_member_add_string(wb, "remote", buf);
- stream_capabilities_to_json_array(wb, online ? host->sender->capabilities : 0,
- "capabilities");
+ stream_capabilities_to_json_array(wb, host->sender->capabilities, "capabilities");
buffer_json_member_add_object(wb, "traffic");
{