Skip to content

Commit 7524d5b

Browse files
committed
Tweak conditions on calling proxy_tls_close()
1 parent 5712059 commit 7524d5b

2 files changed

Lines changed: 10 additions & 11 deletions

File tree

src/main/process.c

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6297,16 +6297,15 @@ static void event_new_fd(void *ctx)
62976297
this->dead = true;
62986298

62996299
remove_now:
6300-
#ifdef WITH_TLS
6301-
/*
6302-
* Close it. Which sets the status to EOL, so we
6303-
* have to update that, too.
6304-
*
6305-
* proxy_tls_close also clears this->tls, so it's
6306-
* safe run this check multiple times, as the
6307-
* second time it won't close the same socket.
6308-
*/
6309-
if ((this->type == RAD_LISTEN_PROXY) && this->tls) {
6300+
sock = this->data;
6301+
6302+
#if defined(WITH_PROXY) && defined(WITH_TLS)
6303+
if ((this->type == RAD_LISTEN_PROXY) && sock->ssn) {
6304+
/*
6305+
* Close it. Which sets the status to EOL, so we
6306+
* have to update that, too.
6307+
*/
6308+
sock->client_closed = true; /* no need to call SSL_shutdown() */
63106309
proxy_tls_close(this);
63116310
this->status = RAD_LISTEN_STATUS_REMOVE_NOW;
63126311
}
@@ -6356,7 +6355,6 @@ static void event_new_fd(void *ctx)
63566355
#endif
63576356
) {
63586357
home_server_t *home;
6359-
sock = this->data;
63606358

63616359
home = sock->home;
63626360
if (!home || !home->limit.max_connections) {

src/main/tls_listen.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ void tls_socket_close(rad_listen_t *listener)
9292
ROPTIONAL(RDEBUG3, DEBUG3, "(TLS) Closing connection");
9393
rad_free(&sock->packet);
9494
TALLOC_FREE(sock->request);
95+
TALLOC_FREE(sock->ssn);
9596
radius_update_listener(listener);
9697

9798
/*

0 commit comments

Comments
 (0)