Issue 169 - Socket Connection Timeout Patch
Summary: Socket Connection Timeout Patch
Status: VERIFIED FIXED
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: slapd (show other issues)
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 1999-05-20 08:40 UTC by pklaus@pylonsoft.ch
Modified: 2014-08-01 21:07 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description pklaus@pylonsoft.ch 1999-05-20 08:40:57 UTC
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.
Comment 1 Kurt Zeilenga 1999-05-22 00:07:57 UTC
moved from Incoming to Software Bugs
Comment 2 Kurt Zeilenga 1999-05-24 18:01:57 UTC
changed notes
changed state Open to Feedback
Comment 3 Kurt Zeilenga 1999-05-24 18:10:43 UTC
moved from Software Bugs to Software Enhancements
Comment 4 Kurt Zeilenga 1999-05-25 15:01:51 UTC
Phillip,

This seems like a reasonable approach to work in
cooperation with a TCP KeepAlive approach.  I've
committed a KeepAlive approach to -devel.  (See
discussions on the -devel mailing list).

A couple of suggestions for the inactive timer:
 * timeout of zero (0) should disable the timer
 * default timeout should be zero (0) (ie: disabled).
 * difftime() should be used to compare times
 * code should be ported to -devel

Is is possible for you to make some or all of
these changes and following up your ITS with
a new tarball?

Porting to -devel, of course, would require CVS access.

Kurt
Comment 5 Kurt Zeilenga 1999-05-25 18:35:36 UTC
changed notes
Comment 6 Kurt Zeilenga 1999-05-25 18:36:08 UTC
changed notes
Comment 7 Kurt Zeilenga 1999-06-21 23:47:07 UTC
changed notes
changed state Feedback to Test
Comment 8 Kurt Zeilenga 1999-12-12 01:02:10 UTC
changed notes
changed state Test to Closed
Comment 9 OpenLDAP project 2014-08-01 21:07:00 UTC
See -devel mailing list for discussions.
See ITS#175 for updated submission.
Solution committed to devel.