From: Alan T. DeKok Date: Tue, 7 Feb 2023 15:26:11 +0000 (-0500) Subject: don't close the socket after one reply packet on single connect X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f633e01f9eec1a911a9f6dcb732e3a8753ea90fc;p=thirdparty%2Ffreeradius-server.git don't close the socket after one reply packet on single connect the "single connect" flag refers to a session, not to a particular packet exchange. --- diff --git a/src/listen/tacacs/proto_tacacs_tcp.c b/src/listen/tacacs/proto_tacacs_tcp.c index 55863feab5c..08ee5baf6b0 100644 --- a/src/listen/tacacs/proto_tacacs_tcp.c +++ b/src/listen/tacacs/proto_tacacs_tcp.c @@ -223,18 +223,9 @@ static ssize_t mod_write(fr_listen_t *li, UNUSED void *packet_ctx, UNUSED fr_tim if (data_size <= 0) return data_size; /* - * If the "use single connection" flag is clear, then we - * are only doing a single session. In which case, - * return 0, which tells the caller to close the socket. + * Return the packet we wrote, plus any bytes previously + * left over from previous packets. */ - if (((pkt->hdr.flags & FR_FLAGS_VALUE_SINGLE_CONNECT) == 0) && - (data_size + written) >= buffer_len) { - // @todo - check status for pass / fail / error, which - // cause the connection to be closed. Everything else - // leaves it open. - return 0; - } - return data_size + written; }