s4:libcli/wrepl: make use of tstream_bsd_fail_readv_first_error(false)
authorStefan Metzmacher <metze@samba.org>
Thu, 12 Jan 2023 09:43:21 +0000 (10:43 +0100)
committerRalph Boehme <slow@samba.org>
Tue, 24 Oct 2023 09:36:38 +0000 (09:36 +0000)
As a client we want recv pending responses even if the server
already closed the connection.

While tstream_bsd_fail_readv_first_error(false) is the default for
tstream_bsd, the wins replication protocol is special as it has
a way to switch server and client roles on an existing tcp connection.

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

index c4f0174665c4b00a3c24ae3ec71fcc855143711d..001363dd2395c07fb5765f336676069dd53e1473 100644 (file)
@@ -108,6 +108,8 @@ NTSTATUS wrepl_socket_donate_stream(struct wrepl_socket *wrepl_socket,
        }
 
        wrepl_socket->stream = talloc_move(wrepl_socket, stream);
+       /* as client we want to drain the recv queue on error */
+       tstream_bsd_fail_readv_first_error(wrepl_socket->stream, false);
        return NT_STATUS_OK;
 }