Skip to content

Commit dd5d571

Browse files
committed
have status server just call tls_socket_close()
instead of doing it itself
1 parent 6f3fff7 commit dd5d571

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

src/main/listen.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,8 @@ static void listener_coa_update(rad_listen_t *this, VALUE_PAIR *vps);
391391
# define TLS_FREE(_x)
392392
#endif
393393

394+
void tls_socket_close(rad_listen_t *listener);
395+
394396
/*
395397
* Process and reply to a server-status request.
396398
* Like rad_authenticate and rad_accounting this should
@@ -440,10 +442,7 @@ int rad_status_server(REQUEST *request)
440442
RWDEBUG("(TLS) Connection is not authorized - closing TCP socket.");
441443
request->reply->code = PW_CODE_ACCESS_REJECT;
442444

443-
rad_free(&sock->packet);
444-
TLS_FREE(sock->request);
445-
listener->status = RAD_LISTEN_STATUS_EOL;
446-
listener->tls = NULL; /* parent owns this! */
445+
tls_socket_close(listener);
447446
}
448447

449448
PTHREAD_MUTEX_UNLOCK(&sock->mutex);

src/main/tls_listen.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ static void dump_hex(char const *msg, uint8_t const *data, size_t data_len)
7474
/*
7575
* Called with the mutex held.
7676
*/
77-
static void tls_socket_close(rad_listen_t *listener)
77+
void tls_socket_close(rad_listen_t *listener);
78+
79+
void tls_socket_close(rad_listen_t *listener)
7880
{
7981
listen_socket_t *sock = listener->data;
8082
REQUEST *request = sock->request;

0 commit comments

Comments
 (0)