You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by wr...@apache.org on 2009/05/15 22:40:24 UTC

svn commit: r775320 - /httpd/httpd/trunk/server/log.c

Author: wrowe
Date: Fri May 15 20:40:24 2009
New Revision: 775320

URL: http://svn.apache.org/viewvc?rev=775320&view=rev
Log:
Ease migration for the hosts of piped loggers out there, handle the
log process selection (| vs $ vs default) in ap_open_piped_log

Modified:
    httpd/httpd/trunk/server/log.c

Modified: httpd/httpd/trunk/server/log.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/log.c?rev=775320&r1=775319&r2=775320&view=diff
==============================================================================
--- httpd/httpd/trunk/server/log.c (original)
+++ httpd/httpd/trunk/server/log.c Fri May 15 20:40:24 2009
@@ -1102,7 +1102,21 @@
 AP_DECLARE(piped_log *) ap_open_piped_log(apr_pool_t *p,
                                           const char *program)
 {
-   return ap_open_piped_log_ex(p, program, APR_PROGRAM_ENV);
+    apr_cmdtype_e cmdtype = APR_PROGRAM_ENV;
+
+    /* In 2.4 favor PROGRAM_ENV, accept "||prog" syntax for compatibility
+     * and "|$cmd" to override the default.
+     * Any 2.2 backport would continue to favor SHELLCMD_ENV so there 
+     * accept "||prog" to override, and "|$cmd" to ease conversion.
+     */
+    if (*program == '|')
+        ++program;
+    if (*program == '$') {
+        cmdtype = APR_SHELLCMD_ENV;
+        ++program;
+    }
+
+    return ap_open_piped_log_ex(p, program, cmdtype);
 }
 
 AP_DECLARE(void) ap_close_piped_log(piped_log *pl)