s3:rpc_server: make use of tstream_bsd_fail_readv_first_error(true)
authorStefan Metzmacher <metze@samba.org>
Thu, 12 Jan 2023 09:49:13 +0000 (10:49 +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>
source3/rpc_server/rpc_host.c
source3/rpc_server/rpc_worker.c

index 92222dd17d4324506cc19babddac30b57ade7175..ab9ad33c56226daec019d0b62408fc30dd4327dd 100644 (file)
@@ -967,6 +967,8 @@ static struct tevent_req *rpc_host_bind_read_send(
                close(sock_dup);
                return tevent_req_post(req, ev);
        }
+       /* as server we want to fail early */
+       tstream_bsd_fail_readv_first_error(state->plain, true);
 
        if (transport == NCACN_NP) {
                subreq = tstream_npa_accept_existing_send(
index e923110940d10fd5dcda0ca47ad29bfcac4367e5..8ed7444e003a46f5e9210e0d4a96bd8736ad7173 100644 (file)
@@ -390,6 +390,8 @@ static void rpc_worker_new_client(
                                  strerror(errno));
                        goto fail;
                }
+               /* as server we want to fail early */
+               tstream_bsd_fail_readv_first_error(tstream, true);
        }
        sock = -1;