s4:service_named_pipe: make use of tstream_bsd_fail_readv_first_error(true)
authorStefan Metzmacher <metze@samba.org>
Thu, 12 Jan 2023 09:46:56 +0000 (10:46 +0100)
committerRalph Boehme <slow@samba.org>
Tue, 24 Oct 2023 09:36:38 +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/samba/service_named_pipe.c

index 4b880fd85a3a028a0d3311a9d8a24c04f41f817d..bf2350c1a60f00b11d91e7f23a82ff9b282c801f 100644 (file)
@@ -66,6 +66,8 @@ static void named_pipe_accept(struct stream_connection *conn)
                                "named_pipe_accept: out of memory");
                return;
        }
+       /* as server we want to fail early */
+       tstream_bsd_fail_readv_first_error(plain_tstream, true);
 
        subreq = tstream_npa_accept_existing_send(conn, conn->event.ctx,
                                                  plain_tstream,