1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-22 02:50:28 +03:00

s4:ldap_server: let ldapsrv_call_writev_start use conn_idle_time to limit the time

If the client is not able to receive the results within connections idle
time, then we should treat it as dead. It's value is 15 minutes (900 s)
by default.

In order to limit that further an admin can use 'socket options'
and set TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL and/or TCP_USER_TIMEOUT
to useful values.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15202

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Wed Oct 19 17:13:39 UTC 2022 on sn-devel-184

(cherry picked from commit eb2f3526032803f34c88ef1619a832a741f71910)
This commit is contained in:
Stefan Metzmacher 2022-10-13 10:17:25 +02:00 committed by Jule Anger
parent b615bf4333
commit 743a56e5cc

View File

@ -697,6 +697,7 @@ static void ldapsrv_call_writev_start(struct ldapsrv_call *call)
struct ldapsrv_connection *conn = call->conn;
struct ldapsrv_reply *reply = NULL;
struct tevent_req *subreq = NULL;
struct timeval endtime;
size_t length = 0;
size_t i;
@ -781,6 +782,10 @@ static void ldapsrv_call_writev_start(struct ldapsrv_call *call)
ldapsrv_terminate_connection(conn, "stream_writev_queue_send failed");
return;
}
endtime = timeval_current_ofs(conn->limits.conn_idle_time, 0);
tevent_req_set_endtime(subreq,
conn->connection->event.ctx,
endtime);
tevent_req_set_callback(subreq, ldapsrv_call_writev_done, call);
}