1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-11 16:58:40 +03:00

s4:wrepl_server: make use of tstream_bsd_fail_readv_first_error(true)

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>
This commit is contained in:
Stefan Metzmacher 2023-01-12 10:46:20 +01:00 committed by Ralph Boehme
parent 0e83b56403
commit 82b2a379e8

View File

@ -133,6 +133,8 @@ static void wreplsrv_accept(struct stream_connection *conn)
return;
}
socket_set_flags(conn->socket, SOCKET_FLAG_NOCLOSE);
/* as server we want to fail early */
tstream_bsd_fail_readv_first_error(wrepl_conn->tstream, true);
wrepl_conn->conn = conn;
wrepl_conn->service = service;
@ -388,6 +390,9 @@ NTSTATUS wreplsrv_in_connection_merge(struct wreplsrv_partner *partner,
return NT_STATUS_NO_MEMORY;
}
/* we're now a server and want to fail early */
tstream_bsd_fail_readv_first_error(wrepl_in->tstream, true);
/*
* The wrepl pdu's has the length as 4 byte (initial_read_size),
* packet_full_request_u32 provides the pdu length then.