go-ldap / ldap

Basic LDAP v3 functionality for the GO programming language.
Other
2.24k stars 355 forks source link

how to set ldapsearch timeout? #528

Closed fpawel closed 2 months ago

fpawel commented 2 months ago

Could you please clarify how to CORRECTLY set the timeout for the ldapsearch operation.

I see SearchRequest.TimeLimit . As far as I can tell, this option limits the maximum duration of ldapsearch, but it is not clear to me in what units this limitation works - seconds, milliseconds, nanoseconds?

cpuschma commented 2 months ago

Hi, the TimeLimit fields represents the maximum amount of time the server SHOULD use to calculate the result. See RFC 2251:

timelimit: A timelimit that restricts the maximum time (in seconds) allowed for a search. A value of 0 in this field indicates that no client-requested timelimit restrictions are in effect for the search.

fpawel commented 2 months ago

@cpuschma Thanks for your help!