You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by co...@apache.org on 2015/07/07 16:43:32 UTC

svn commit: r1689694 - /httpd/httpd/trunk/modules/ldap/util_ldap.c

Author: covener
Date: Tue Jul  7 14:43:31 2015
New Revision: 1689694

URL: http://svn.apache.org/r1689694
Log:
stuff unexpected LDAP errors into ldc->reason, not just in trace messages.
fix some enormously long lines introduced recently.


Modified:
    httpd/httpd/trunk/modules/ldap/util_ldap.c

Modified: httpd/httpd/trunk/modules/ldap/util_ldap.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/ldap/util_ldap.c?rev=1689694&r1=1689693&r2=1689694&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/ldap/util_ldap.c (original)
+++ httpd/httpd/trunk/modules/ldap/util_ldap.c Tue Jul  7 14:43:31 2015
@@ -1097,7 +1097,9 @@ static int uldap_cache_compare(request_r
                     ldc->reason = "Comparison no such attribute (cached)";
                 }
                 else {
-                    ldc->reason = "Comparison undefined (cached)";
+                    ldc->reason = apr_psprintf(r->pool, 
+                                              "Comparison undefined: (%d): %s (adding to cache)", 
+                                              result, ldap_err2string(result));
                 }
 
                 /* record the result code to return with the reason... */
@@ -1105,7 +1107,9 @@ static int uldap_cache_compare(request_r
                 /* and unlock this read lock */
                 LDAP_CACHE_UNLOCK();
 
-                ap_log_rerror(APLOG_MARK, APLOG_TRACE5, 0, r, "ldap_compare_s(%pp, %s, %s, %s) = %s (cached)", ldc->ldap, dn, attrib, value, ldap_err2string(result));
+                ap_log_rerror(APLOG_MARK, APLOG_TRACE5, 0, r, 
+                              "ldap_compare_s(%pp, %s, %s, %s) = %s (cached)", 
+                              ldc->ldap, dn, attrib, value, ldap_err2string(result));
                 return result;
             }
         }
@@ -1200,11 +1204,16 @@ start_over:
             ldc->reason = "Comparison no such attribute (adding to cache)";
         }
         else {
+            ldc->reason = apr_psprintf(r->pool, 
+                                       "Comparison undefined: (%d): %s (adding to cache)", 
+                                        result, ldap_err2string(result));
             ldc->reason = "Comparison undefined (adding to cache)";
         }
     }
 
-    ap_log_rerror(APLOG_MARK, APLOG_TRACE5, 0, r, "ldap_compare_s(%pp, %s, %s, %s) = %s", ldc->ldap, dn, attrib, value, ldap_err2string(result));
+    ap_log_rerror(APLOG_MARK, APLOG_TRACE5, 0, r, 
+                  "ldap_compare_s(%pp, %s, %s, %s) = %s", 
+                  ldc->ldap, dn, attrib, value, ldap_err2string(result));
     return result;
 }
 



Re: svn commit: r1689694 - /httpd/httpd/trunk/modules/ldap/util_ldap.c

Posted by Eric Covener <co...@gmail.com>.
On Tue, Jul 7, 2015 at 11:13 AM, Mike Rumph <mi...@oracle.com> wrote:
>> +                                       "Comparison undefined: (%d): %s
>> (adding to cache)",
>> +                                        result, ldap_err2string(result));
>>               ldc->reason = "Comparison undefined (adding to cache)";
>
> The above line should be removed, correct?


!!! yes, thanks


-- 
Eric Covener
covener@gmail.com

Re: svn commit: r1689694 - /httpd/httpd/trunk/modules/ldap/util_ldap.c

Posted by Mike Rumph <mi...@oracle.com>.
Comment inline below:
On 7/7/2015 7:43 AM, covener@apache.org wrote:
> Author: covener
> Date: Tue Jul  7 14:43:31 2015
> New Revision: 1689694
>
> URL: http://svn.apache.org/r1689694
> Log:
> stuff unexpected LDAP errors into ldc->reason, not just in trace messages.
> fix some enormously long lines introduced recently.
>
>
> Modified:
>      httpd/httpd/trunk/modules/ldap/util_ldap.c
>
> Modified: httpd/httpd/trunk/modules/ldap/util_ldap.c
> URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/ldap/util_ldap.c?rev=1689694&r1=1689693&r2=1689694&view=diff
> ==============================================================================
> --- httpd/httpd/trunk/modules/ldap/util_ldap.c (original)
> +++ httpd/httpd/trunk/modules/ldap/util_ldap.c Tue Jul  7 14:43:31 2015
> @@ -1097,7 +1097,9 @@ static int uldap_cache_compare(request_r
>                       ldc->reason = "Comparison no such attribute (cached)";
>                   }
>                   else {
> -                    ldc->reason = "Comparison undefined (cached)";
> +                    ldc->reason = apr_psprintf(r->pool,
> +                                              "Comparison undefined: (%d): %s (adding to cache)",
> +                                              result, ldap_err2string(result));
>                   }
>   
>                   /* record the result code to return with the reason... */
> @@ -1105,7 +1107,9 @@ static int uldap_cache_compare(request_r
>                   /* and unlock this read lock */
>                   LDAP_CACHE_UNLOCK();
>   
> -                ap_log_rerror(APLOG_MARK, APLOG_TRACE5, 0, r, "ldap_compare_s(%pp, %s, %s, %s) = %s (cached)", ldc->ldap, dn, attrib, value, ldap_err2string(result));
> +                ap_log_rerror(APLOG_MARK, APLOG_TRACE5, 0, r,
> +                              "ldap_compare_s(%pp, %s, %s, %s) = %s (cached)",
> +                              ldc->ldap, dn, attrib, value, ldap_err2string(result));
>                   return result;
>               }
>           }
> @@ -1200,11 +1204,16 @@ start_over:
>               ldc->reason = "Comparison no such attribute (adding to cache)";
>           }
>           else {
> +            ldc->reason = apr_psprintf(r->pool,
> +                                       "Comparison undefined: (%d): %s (adding to cache)",
> +                                        result, ldap_err2string(result));
>               ldc->reason = "Comparison undefined (adding to cache)";
The above line should be removed, correct?
>           }
>       }
>   
> -    ap_log_rerror(APLOG_MARK, APLOG_TRACE5, 0, r, "ldap_compare_s(%pp, %s, %s, %s) = %s", ldc->ldap, dn, attrib, value, ldap_err2string(result));
> +    ap_log_rerror(APLOG_MARK, APLOG_TRACE5, 0, r,
> +                  "ldap_compare_s(%pp, %s, %s, %s) = %s",
> +                  ldc->ldap, dn, attrib, value, ldap_err2string(result));
>       return result;
>   }
>   
>
>
>
>