Skip to content

Commit

Permalink
Misc code cleanup (netdata#18540)
Browse files Browse the repository at this point in the history
Code cleanup
  • Loading branch information
stelfrag committed Sep 16, 2024
1 parent 0a6c06e commit 39a3bff
Show file tree
Hide file tree
Showing 10 changed files with 2 additions and 33 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1339,7 +1339,6 @@ set(CLAIM_WINDOWS_FILES
)

set(ACLK_ALWAYS_BUILD
src/aclk/aclk_rrdhost_state.h
src/aclk/aclk_proxy.c
src/aclk/aclk_proxy.h
src/aclk/aclk.c
Expand Down
2 changes: 1 addition & 1 deletion src/aclk/aclk.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "daemon/common.h"

#include "aclk_util.h"
#include "aclk_rrdhost_state.h"
//#include "aclk_rrdhost_state.h"

// How many MQTT PUBACKs we need to get to consider connection
// stable for the purposes of TBEB (truncated binary exponential backoff)
Expand Down
1 change: 0 additions & 1 deletion src/aclk/aclk_alarm_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include "../daemon/common.h"
#include "schema-wrappers/schema_wrappers.h"

//void aclk_send_provide_alarm_checkpoint(struct alarm_checkpoint *checkpoint);
void aclk_send_alarm_log_entry(struct alarm_log_entry *log_entry);
void aclk_send_provide_alarm_cfg(struct provide_alarm_configuration *cfg);
void aclk_send_alarm_snapshot(alarm_snapshot_proto_ptr_t snapshot);
Expand Down
7 changes: 0 additions & 7 deletions src/aclk/aclk_query.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,8 @@
#include "aclk_tx_msgs.h"
#include "../../web/server/web_client_cache.h"

#define WEB_HDR_ACCEPT_ENC "Accept-Encoding:"

static HTTP_ACL default_aclk_http_acl = HTTP_ACL_ALL_FEATURES;

pthread_cond_t query_cond_wait = PTHREAD_COND_INITIALIZER;
pthread_mutex_t query_lock_wait = PTHREAD_MUTEX_INITIALIZER;
#define QUERY_THREAD_LOCK pthread_mutex_lock(&query_lock_wait)
#define QUERY_THREAD_UNLOCK pthread_mutex_unlock(&query_lock_wait)

struct pending_req_list {
const char *msg_id;
uint32_t hash;
Expand Down
11 changes: 0 additions & 11 deletions src/aclk/aclk_rrdhost_state.h

This file was deleted.

5 changes: 0 additions & 5 deletions src/aclk/aclk_rx_msgs.h
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@


// SPDX-License-Identifier: GPL-3.0-or-later

#ifndef ACLK_RX_MSGS_H
#define ACLK_RX_MSGS_H

#include "daemon/common.h"
#include "libnetdata/libnetdata.h"

int aclk_handle_cloud_cmd_message(char *payload);

const char *rx_handler_get_name(size_t i);
void aclk_init_rx_msg_handlers(void);
void aclk_handle_new_cloud_msg(const char *message_type, const char *msg, size_t msg_len, const char *topic);

Expand Down
3 changes: 0 additions & 3 deletions src/aclk/aclk_tx_msgs.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,6 @@ short aclk_http_msg_v2(mqtt_wss_client client, const char *topic, const char *ms
case HTTP_RESP_INTERNAL_SERVER_ERROR:
aclk_http_msg_v2_err(client, topic, msg_id, rc, CLOUD_EC_FAIL_TOPIC, CLOUD_EMSG_FAIL_TOPIC, payload, payload_len);
break;
// case HTTP_RESP_SERVICE_UNAVAILABLE:
// aclk_http_msg_v2_err(client, topic, msg_id, rc, CLOUD_EC_SND_TIMEOUT, CLOUD_EMSG_SND_TIMEOUT, payload, payload_len);
// break;
default:
rc = http_code;
break;
Expand Down
1 change: 0 additions & 1 deletion src/aclk/aclk_tx_msgs.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

#include <json-c/json.h>
#include "libnetdata/libnetdata.h"
#include "daemon/common.h"
#include "mqtt_websockets/mqtt_wss_client.h"
#include "schema-wrappers/schema_wrappers.h"
#include "aclk_util.h"
Expand Down
2 changes: 0 additions & 2 deletions src/aclk/aclk_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ usec_t aclk_session_newarch = 0;

aclk_env_t *aclk_env = NULL;

int chart_batch_id;

aclk_encoding_type_t aclk_encoding_type_t_from_str(const char *str) {
if (!strcmp(str, "json")) {
return ACLK_ENC_JSON;
Expand Down
2 changes: 1 addition & 1 deletion src/database/rrd.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ struct ml_metrics_statistics {
#include "streaming/stream_capabilities.h"
#include "streaming/stream_path.h"
#include "streaming/rrdpush.h"
#include "aclk/aclk_rrdhost_state.h"
//#include "aclk/aclk_rrdhost_state.h"
#include "sqlite/sqlite_health.h"

typedef struct storage_query_handle STORAGE_QUERY_HANDLE;
Expand Down

0 comments on commit 39a3bff

Please sign in to comment.