From 8b1c08dd93a5b18e2f8202fa0379f7724fcbf18c Mon Sep 17 00:00:00 2001 From: "Alan T. DeKok" Date: Thu, 25 May 2023 15:06:48 -0400 Subject: [PATCH] add and set connection timeout to outbound listeners --- src/include/listen.h | 1 + src/main/listen.c | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/src/include/listen.h b/src/include/listen.h index e8222a3f02..865b6b62b5 100644 --- a/src/include/listen.h +++ b/src/include/listen.h @@ -159,6 +159,7 @@ typedef struct listen_socket_t { tls_session_t *ssn; REQUEST *request; /* horrible hacks */ VALUE_PAIR *certs; + uint32_t connect_timeout; pthread_mutex_t mutex; uint8_t *data; size_t partial; diff --git a/src/main/listen.c b/src/main/listen.c index e5f8d6dde3..764122bbb2 100644 --- a/src/main/listen.c +++ b/src/main/listen.c @@ -3049,6 +3049,11 @@ rad_listen_t *proxy_new_listener(TALLOC_CTX *ctx, home_server_t *home, uint16_t */ this->fd = fr_socket_client_tcp(&home->src_ipaddr, &home->ipaddr, home->port, false); + + /* + * Set max_requests, lifetime, and idle_timeout from the home server. + */ + sock->limit = home->limit; } else #endif this->fd = fr_socket(&home->src_ipaddr, src_port); @@ -3089,6 +3094,8 @@ rad_listen_t *proxy_new_listener(TALLOC_CTX *ctx, home_server_t *home, uint16_t goto error; } + sock->connect_timeout = home->connect_timeout; + this->recv = proxy_tls_recv; this->proxy_send = proxy_tls_send; -- 2.47.3