[Date Prev][Date Next] [Chronological] [Thread] [Top]

Socket Connection Timeout Patch (ITS#169)



Full_Name: Philipp Klaus
Version: 1.2.1
OS: Linux
URL: http://www.internet.access.ch/openldap/ldap_timeout.patch
Submission from: (NULL) (195.112.64.100)


OpenLDAP in release 1.2.1 didn't handle timeouts on ldap connections. If a
connection
was opened and not correctly closed by the client (caused by a bad network
connection
p.e) the slapd holds the connection forever and after some time it will run out
of
file descriptors (for the sockets).

I implemented a simple timeout handling by adding a last activity field to the
connection structure. Each time a read or write access is made to a connection,
this
field is set to the current time. In each loop this value is checked against
the
current time and if the difference is greater than the value set in the
configuration
file the connection is closed by the server.

All changes are ifdef'ed with _INA_CONN_TIMEOUT to enable compiling without the
patch.

The diff is done against the current release (1.2.1) because I couldn't find a
devel
tarball and I am not very used to the CVS system (sorry).

All code is given to the open source community free of any charge.