s4:kdc: make use of tstream_bsd_fail_readv_first_error(true)
authorStefan Metzmacher <metze@samba.org>
Thu, 12 Jan 2023 09:38:53 +0000 (10:38 +0100)
committerRalph Boehme <slow@samba.org>
Tue, 24 Oct 2023 09:36:37 +0000 (09:36 +0000)
This avoids doing useless work in case the client connection
is already broken.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/kdc/kdc-server.c

index 54ee79285f43475875e2b18b7ba416d7b77d6239..ba56f04e71b5ff89e6c37510b187d47c10ecf8d6 100644 (file)
@@ -496,6 +496,8 @@ static void kdc_tcp_accept(struct stream_connection *conn)
                                "kdc_tcp_accept: out of memory");
                return;
        }
+       /* as server we want to fail early */
+       tstream_bsd_fail_readv_first_error(kdc_conn->tstream, true);
 
        kdc_conn->conn = conn;
        kdc_conn->kdc_socket = kdc_socket;