summaryrefslogtreecommitdiffstats
path: root/src/aclk/aclk_proxy.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-11-25 17:33:56 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-11-25 17:34:10 +0000
commit83ba6762cc43d9db581b979bb5e3445669e46cc2 (patch)
tree2e69833b43f791ed253a7a20318b767ebe56cdb8 /src/aclk/aclk_proxy.c
parentReleasing debian version 1.47.5-1. (diff)
downloadnetdata-83ba6762cc43d9db581b979bb5e3445669e46cc2.tar.xz
netdata-83ba6762cc43d9db581b979bb5e3445669e46cc2.zip
Merging upstream version 2.0.3+dfsg (Closes: #923993, #1042533, #1045145).
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/aclk/aclk_proxy.c')
-rw-r--r--src/aclk/aclk_proxy.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/aclk/aclk_proxy.c b/src/aclk/aclk_proxy.c
index 8d0e2d657..a6185db7c 100644
--- a/src/aclk/aclk_proxy.c
+++ b/src/aclk/aclk_proxy.c
@@ -79,7 +79,7 @@ static inline int check_socks_enviroment(const char **proxy)
{
char *tmp = getenv("socks_proxy");
- if (!tmp)
+ if (!tmp || !*tmp)
return 1;
if (aclk_verify_proxy(tmp) == PROXY_TYPE_SOCKS5) {
@@ -97,7 +97,7 @@ static inline int check_http_enviroment(const char **proxy)
{
char *tmp = getenv("http_proxy");
- if (!tmp)
+ if (!tmp || !*tmp)
return 1;
if (aclk_verify_proxy(tmp) == PROXY_TYPE_HTTP) {
@@ -113,15 +113,11 @@ static inline int check_http_enviroment(const char **proxy)
const char *aclk_lws_wss_get_proxy_setting(ACLK_PROXY_TYPE *type)
{
- const char *proxy = appconfig_get(&cloud_config, CONFIG_SECTION_GLOBAL, ACLK_PROXY_CONFIG_VAR, ACLK_PROXY_ENV);
-
- // backward compatibility: "proxy" was in "netdata.conf"
- if (config_exists(CONFIG_SECTION_CLOUD, ACLK_PROXY_CONFIG_VAR))
- proxy = config_get(CONFIG_SECTION_CLOUD, ACLK_PROXY_CONFIG_VAR, ACLK_PROXY_ENV);
+ const char *proxy = cloud_config_proxy_get();
*type = PROXY_DISABLED;
- if (strcmp(proxy, "none") == 0)
+ if (!proxy || !*proxy || strcmp(proxy, "none") == 0)
return proxy;
if (strcmp(proxy, ACLK_PROXY_ENV) == 0) {