summaryrefslogtreecommitdiffstats
path: root/src/aclk/https_client.c
diff options
context:
space:
mode:
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 8c44f13e3..4a0362992 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;