[Date Prev][Date Next]
Bugfix: wait4msg() hangs when using SSL/TLS (ITS#445)
Full_Name: Andrew Hacking
Submission from: (NULL) (18.104.22.168)
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)