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

Bugfix: wait4msg() hangs when using SSL/TLS (ITS#445)



Full_Name: Andrew Hacking
Version: -devel
OS: Linux
URL: ftp://ftp.openldap.org/incoming/andrew-hacking-000208-2.patch
Submission from: (NULL) (24.192.12.154)


libldap wait4msg() hangs under various conditions when using SSL/TLS.

The specifics are that wait4msg blocks in do_ldap_select()
while waiting for data that has _already_ been buffered by the
OpenSSL library. do_ldap_select() should never be called until
the SSL/TLS buffers have been exhausted.

The patch changes to wait4msg() changes the way messages are read to ensure the
SSL/TLS buffers really are exhausted before calling do_ldap_select()

try_read1msg() is also changed to return 'exhausted' (-3) on an
EWOULDBLOCK/EAGAIN condition.  This differentiates EWOULDBLOCK/EAGAIN
(ie the underlying sockbuf is now exhausted) with the 'keep looking' (-2)
condition.