Return-Path: Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: (qmail 91435 invoked from network); 26 Apr 2005 23:59:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 26 Apr 2005 23:59:11 -0000 Received: (qmail 75645 invoked by uid 500); 26 Apr 2005 23:59:57 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 74678 invoked by uid 500); 26 Apr 2005 23:59:55 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 74650 invoked by uid 99); 26 Apr 2005 23:59:54 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from sinclair.provo.novell.com (HELO sinclair.provo.novell.com) (137.65.81.169) by apache.org (qpsmtpd/0.28) with ESMTP; Tue, 26 Apr 2005 16:59:54 -0700 Received: from INET-PRV-MTA by sinclair.provo.novell.com with Novell_GroupWise; Tue, 26 Apr 2005 17:59:05 -0600 Message-Id: X-Mailer: Novell GroupWise Internet Agent 6.5.4 Date: Tue, 26 Apr 2005 17:58:52 -0600 From: "Brad Nicholes" To: , Cc: Subject: Moved the ldap connection timeout call (was: Re: svn commit: r160707 ) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 500/1000/N I just checked in a patch to move the ldap_set_option() call from trying = to set the connection timeout globally to ldap connection specific. I = don't have a good way to test that it fixes the problem, but if somebody = can verify the fix, I will propose it for backport. Brad >>> chip@force-elite.com Tuesday, April 26, 2005 10:11:34 AM >>> bnicholes@apache.org wrote: > Author: bnicholes > Date: Sat Apr 9 12:00:18 2005 > New Revision: 160707 >=20 > URL: http://svn.apache.org/viewcvs?view=3Drev&rev=3D160707=20 > Log: > Added a new LDAPConnectionTimeout directive to util_ldap so that the = socket connection timeout value is configurable. >=20 > Reviewed by: bnicholes, trawick, jim .... > @@ -1379,6 +1404,7 @@ > =20 > void *data; > const char *userdata_key =3D "util_ldap_init"; > + struct timeval timeOut =3D {10,0}; /* 10 second connection = timeout */ > =20 > /* util_ldap_post_config() will be called twice. Don't bother > * going through all of the initialization on the first call > @@ -1603,6 +1629,20 @@ > "LDAP: SSL support unavailable" ); > } > =20 > +#ifdef LDAP_OPT_NETWORK_TIMEOUT > + if (st->connectionTimeout > 0) { > + timeOut.tv_sec =3D st->connectionTimeout; > + } > + > + if (st->connectionTimeout >=3D 0) { > + rc =3D ldap_set_option(NULL, LDAP_OPT_NETWORK_TIMEOUT, (void = *)&timeOut); > + if (APR_SUCCESS !=3D rc) { > + ap_log_error(APLOG_MARK, APLOG_ERR, 0, s, > + "LDAP: Could not set the connection = timeout" ); > + } > + } > +#endif > + > return(OK); > } > =20 .... It looks like this change is causing crashes with PHP: http://issues.apache.org/bugzilla/show_bug.cgi?id=3D34618=20 http://issues.apache.org/bugzilla/show_bug.cgi?id=3D34620=20 I think the call to ldap_set_option is the cause. Quoting from http://docs.sun.com/source/816-5616-10/function.htm#24534=20 """If NULL, you are setting the default options that will apply to any new LDAP connection handles that are subsequently created. """ Doesn't it seem bad to set this globally? We are trampling on other citizens inside the process. Why isn't this call to ldap_set_option done per-LDAP context? -Paul