Re: [Hastymail-devel] ldap_connect problem (ldap_addressbook plugin)
Brought to you by:
sailfrog,
slushpupie
From: Jason M. <ja...@ha...> - 2011-05-09 18:12:30
|
On Thu, 5 May 2011 13:46:47 -0500 Jesse Thompson <jes...@do...> wrote > It seems that ldap_connect doesn't work as advertised. Even though the > documentation says that ldap_connect does not actually initiate the > connection; it does, at least on my platform. So, this means that > ldap_set_option($ld, LDAP_OPT_NETWORK_TIMEOUT, 1); doesn't actually help > the situation where the interface you are trying to connect to is > dropping packets (e.g. it is blocked by a firewall). > > Attached is a quick hack to check to see if we can get to the port, with > a very short timeout. > > Is there a better way to accomplish this, or is this just a fundamental > problem with ldap_connect? > > Jesse Looks like a change of behavior depending on the open ldap version you are using. From the PHP ldap_connect page: "When OpenLDAP 2.x.x is used, ldap_connect() will always return a resource as it does not actually connect but just initializes the connecting parameters" So in this case you must be using something other than openldap 2.x.x .. ? The patch does not hurt anything for sites that are running openldap 2.x.x so I applied it to SVN rev 1859. Thanks! Jason Munro ja...@ha... http://www.hastymail.org Confidentiality Notice: This email, including attachments, may include non-public, proprietary, confidential or legally privileged information. If you are not an intended recipient or an authorized agent of an intended recipient, you are hereby notified that any dissemination, distribution or copying of the information contained in or transmitted with this e-mail is unauthorized and strictly prohibited. If you have received this email in error, please notify the sender by replying to this message and permanently delete this e-mail, its attachments, and any copies of it immediately – you should not retain, copy or use this e-mail or any attachment for any purpose, nor disclose all or any part of the contents to any other person. Thank you. |