]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
don't close the socket after one reply packet on single connect
authorAlan T. DeKok <aland@freeradius.org>
Tue, 7 Feb 2023 15:26:11 +0000 (10:26 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 7 Feb 2023 15:27:30 +0000 (10:27 -0500)
the "single connect" flag refers to a session, not to a particular
packet exchange.

src/listen/tacacs/proto_tacacs_tcp.c

index 55863feab5ce943239fe9bc4773e29aa5ecf4b5d..08ee5baf6b0e7337dd6861098ae3e54dfad6ac2d 100644 (file)
@@ -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;
 }