https://bugs.openldap.org/show_bug.cgi?id=10657
Issue ID: 10657 Summary: libldap: sockets revert to blocking mode after an async connect (LDAP_OPT_CONNECT_ASYNC) Product: OpenLDAP Version: 2.7.2 Hardware: All OS: All Status: UNCONFIRMED Keywords: needs_review Severity: normal Priority: --- Component: libraries Assignee: bugs@openldap.org Reporter: a.cudbardb@freeradius.org Target Milestone: ---
Created attachment 1243 --> https://bugs.openldap.org/attachment.cgi?id=1243&action=edit Only restore blocking mode when LDAP_OPT_CONNECT_ASYNC is off (os-ip.c, os-local.c)
libldap puts a connection's socket back into blocking mode once an asynchronous connect completes, even when the caller has set LDAP_OPT_CONNECT_ASYNC.
ldap_int_poll() in libraries/libldap/os-ip.c calls ldap_pvt_ndelay_off() unconditionally once the socket is ready. That suits its original caller, ldap_pvt_connect(), which only makes the socket non-blocking to put a timeout on connect(), but ldap_send_server_request() and ldap_int_check_async_open() also call ldap_int_poll() to check whether an async connect has completed, and for those callers it switches off the non-blocking as a side-effect.
The attached patch only restores blocking mode when LDAP_OPT_CONNECT_ASYNC is off. Synchronous callers are unaffected.
https://bugs.openldap.org/show_bug.cgi?id=10657
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |2.7.3 Assignee|bugs@openldap.org |hyc@openldap.org Keywords|needs_review |
https://bugs.openldap.org/show_bug.cgi?id=10657
Howard Chu hyc@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |TEST
--- Comment #1 from Howard Chu hyc@openldap.org --- Thanks, added in git 26a26a87d6aedfc1109cfc47236dbc523656e89a