summaryrefslogtreecommitdiffstats
path: root/src/aclk/https_client.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-30 04:58:00 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-30 04:58:00 +0000
commitd6059c63e99740207604717b19f87f14af93382c (patch)
tree2cb4f0a5a3e608cb0d0f7b52cf28cdf83aa51cba /src/aclk/https_client.c
parentAdding upstream version 1.47.1. (diff)
downloadnetdata-d6059c63e99740207604717b19f87f14af93382c.tar.xz
netdata-d6059c63e99740207604717b19f87f14af93382c.zip
Adding upstream version 1.47.2.upstream/1.47.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/aclk/https_client.c')
-rw-r--r--src/aclk/https_client.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/aclk/https_client.c b/src/aclk/https_client.c
index 8c44f13e..4a036299 100644
--- a/src/aclk/https_client.c
+++ b/src/aclk/https_client.c
@@ -620,13 +620,14 @@ static int cert_verify_callback(int preverify_ok, X509_STORE_CTX *ctx)
return preverify_ok;
}
-int https_request(https_req_t *request, https_req_response_t *response) {
+int https_request(https_req_t *request, https_req_response_t *response, bool *fallback_ipv4)
+{
int rc = 1, ret;
char connect_port_str[PORT_STR_MAX_BYTES];
const char *connect_host = request->proxy_host ? request->proxy_host : request->host;
int connect_port = request->proxy_host ? request->proxy_port : request->port;
- struct timeval timeout = { .tv_sec = request->timeout_s, .tv_usec = 0 };
+ struct timeval timeout = { .tv_sec = 10, .tv_usec = 0 };
https_req_ctx_t *ctx = callocz(1, sizeof(https_req_ctx_t));
ctx->req_start_time = now_realtime_sec();
@@ -639,7 +640,7 @@ int https_request(https_req_t *request, https_req_response_t *response) {
snprintfz(connect_port_str, PORT_STR_MAX_BYTES, "%d", connect_port);
- ctx->sock = connect_to_this_ip46(IPPROTO_TCP, SOCK_STREAM, connect_host, 0, connect_port_str, &timeout);
+ ctx->sock = connect_to_this_ip46(IPPROTO_TCP, SOCK_STREAM, connect_host, 0, connect_port_str, &timeout, fallback_ipv4);
if (ctx->sock < 0) {
netdata_log_error("Error connecting TCP socket to \"%s\"", connect_host);
goto exit_buf_rx;