[Date Prev][Date Next]
Re: (ITS#6828) TLS fails to start when LDAP_OPT_CONNECT_ASYNC is used
- To: openldap-its@OpenLDAP.org
- Subject: Re: (ITS#6828) TLS fails to start when LDAP_OPT_CONNECT_ASYNC is used
- From: email@example.com
- Date: Fri, 24 Jun 2011 23:18:10 GMT
- Auto-submitted: auto-generated (OpenLDAP-ITS)
Ian Puleston wrote:
>> -----Original Message-----
>> From: Howard Chu [mailto:firstname.lastname@example.org]
>> Sent: Wednesday, June 08, 2011 5:47 PM
>> I'm pretty sure that this chunk can never do anything useful.
>> The connection has just been created, asynchronously, so there's no way
>> the TLS layer was already started when it got here.
> After re-reviewing it I think you are correct. I put that in because I thought there may be a chance that ldap_int_tls_start could get called from ldap_int_open_connection if the connect completed very quickly in the underlying layers. But even if it did there has been no call to ldap_int_poll to check for it having completed. ldap_pvt_connect and then ldap_connect_to_host return -2 to ldap_int_open_connection on an async connect. And the latter then only calls ldap_int_tls_start if rc == 0, so that call will not happen.
>> Also, I suggest that you only check for CONNST_CONNECTING in the
>> callers, and do the TLS check in the check function
> Yes, good idea. I guess that the way I have it allows it to start up TLS immediately if using TLS and the connect completes immediately, but if not using TLS it will return LDAP_X_CONNECTING. What you are suggesting means that if not using TLS and the connect completes immediately then it will be able to go ahead and send the request rather than retuning LDAP_X_CONNECTING.
> I will update the fix and supply a new patch shortly.
No need, I already committed a fix to git. It is also in RE24.
-- Howard Chu
CTO, Symas Corp. http://www.symas.com
Director, Highland Sun http://highlandsun.com/hyc/
Chief Architect, OpenLDAP http://www.openldap.org/project/