mirror of
https://github.com/samba-team/samba.git
synced 2025-02-16 09:57:47 +03:00
This will be the core of the logic that allows us to retry break notifications. When we start the "pending break cycle" we ask for the current retransmission timemout (rto) on the TCP connection and remember how many unacked bytes are in the kernel's send queue. Each time we send bytes into the kernel we add them to the unacked bytes. We use a timer using the rto interval in order to check the amount of unacked bytes again. The provides send_queu_entry.ack.req will be completed with tevent_req_done() when everything is completely acked, tevent_req_nterror(NT_STATUS_IO_TIMEOUT) when send_queu_entry.ack.timeout is expired or tevent_req_nterror(connection_error) when the connection gets disconnected. It works with support from the FreeBSD and Linux kernels. For other platforms we just have a fixed rto of 1 second. And pretend all bytes are acked when we recheck after 1 second. So only a connection error could trigger tevent_req_nterror(), but there's no timeout. A follow up commit will most likely disable support for multi-channel if we don't have kernel support. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11897 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>