httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From minf...@apache.org
Subject cvs commit: httpd-2.0/modules/experimental mod_auth_ldap.c
Date Fri, 27 Sep 2002 08:49:48 GMT
minfrin     2002/09/27 01:49:48

  Modified:    .        CHANGES
               modules/experimental mod_auth_ldap.c
  Log:
  Get mod_auth_ldap to retry connections on LDAP_SERVER_DOWN
  Submitted by:	Thomas Bennett <thomas.bennett@eds.com>
  Reviewed by:	Graham Leggett
  
  Revision  Changes    Path
  1.938     +3 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.937
  retrieving revision 1.938
  diff -u -r1.937 -r1.938
  --- CHANGES	26 Sep 2002 08:55:28 -0000	1.937
  +++ CHANGES	27 Sep 2002 08:49:47 -0000	1.938
  @@ -1,5 +1,8 @@
   Changes with Apache 2.0.43
   
  +  *) Get mod_auth_ldap to retry connections on LDAP_SERVER_DOWN.
  +     [Thomas Bennett <thomas.bennett@eds.com>, Graham Leggett]
  +
     *) Make sure the contents of the WWW-Authenticate header is
        passed on a 4xx error by proxy. Previously all headers
        were dropped, resulting in the browser being unable to
  
  
  
  1.8       +12 -0     httpd-2.0/modules/experimental/mod_auth_ldap.c
  
  Index: mod_auth_ldap.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/experimental/mod_auth_ldap.c,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- mod_auth_ldap.c	18 Sep 2002 23:38:30 -0000	1.7
  +++ mod_auth_ldap.c	27 Sep 2002 08:49:48 -0000	1.8
  @@ -218,6 +218,7 @@
    */
   int mod_auth_ldap_check_user_id(request_rec *r)
   {
  +    int failures = 0;
       const char **vals = NULL;
       char filtbuf[FILTER_LENGTH];
       mod_auth_ldap_config_t *sec =
  @@ -243,6 +244,8 @@
           return DECLINED;
       }
   
  +start_over:
  +
       /* There is a good AuthLDAPURL, right? */
       if (sec->host) {
           ldc = util_ldap_connection_find(r, sec->host, sec->port,
  @@ -275,6 +278,15 @@
                                            sec->attributes, filtbuf, sent_pw, &dn,
&vals);
       util_ldap_connection_close(ldc);
   
  +    /* sanity check - if server is down, retry it up to 5 times */
  +    if (result == LDAP_SERVER_DOWN) {
  +        util_ldap_connection_destroy(ldc);
  +        if (failures++ <= 5) {
  +            goto start_over;
  +        }
  +    }
  +
  +    /* handle bind failure */
       if (result != LDAP_SUCCESS) {
           ap_log_rerror(APLOG_MARK, APLOG_WARNING|APLOG_NOERRNO, 0, r, 
                         "[%d] auth_ldap authenticate: "
  
  
  

Mime
View raw message