On Thu, Feb 18, 1999, Roman Maeder wrote:

> I am encountering the following problem with using the %{variable}x
> LogFormat extension from mod_ssl-2.2.2-1.3.4. When the variable is
> not defined, for example %{SSL_CLIENT_S_DN}x for an SSL connection that
> is not authenticated with a client certificate, nothing is printed in
> the logfile. But on the other hand, when directives, such as
> %b (number of bytes sent) or %{Referer}i (the refer(r)er field) have
> no value, Apache prints a - sign. Is this also possible with "x"?

Yes, you're right, my ssl_lookup_variable() function has a reasonable

    if (result == NULL)
       result = "";

at the end which I overlooked when I implemented the extension for
mod_log_config (which wants a NULL to indicate an empty expension). So, to let
not available variables expand to "-" instead of "", you've to apply the
following patch which I'll commit for mod_ssl 2.2.3:

Index: ssl_engine_ext.c
===================================================================
RCS file:
/e/apache/SSL/REPOS/mod_ssl/pkg.apache/src/modules/ssl/ssl_engine_ext.c,v
retrieving revision 1.14
diff -u -r1.14 ssl_engine_ext.c
--- ssl_engine_ext.c    1999/01/21 14:21:59     1.14
+++ ssl_engine_ext.c    1999/02/19 10:17:31
@@ -161,6 +161,8 @@
     result = NULL;
     if (ap_ctx_get(r->connection->client->ctx, "ssl") != NULL)
         result = ssl_var_lookup(r->pool, r->server, r->connection, r, a);
+    if (result != NULL && result[0] == NUL)
+        result = NULL;
     return result;
 }
                                       Ralf S. Engelschall
                                       [EMAIL PROTECTED]
                                       www.engelschall.com
______________________________________________________________________
Apache Interface to SSLeay (mod_ssl)   www.engelschall.com/sw/mod_ssl/
Official Support Mailing List               [EMAIL PROTECTED]
Automated List Manager                       [EMAIL PROTECTED]

Reply via email to