From 5dd173ae5289d8fb7d871e06b3918847d65b6fe9 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 18 Mar 2011 17:12:32 +0000 Subject: [PATCH] separate the issue of passing APLOG_MARK to your own functions and the sometimes-related issue of not passing APLOG_MARK to ap_log_*(), adding coverage for APLOG_MODULE_INDEX git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1082975 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/developer/new_api_2_4.xml | 34 ++++++++++++++++++++------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/docs/manual/developer/new_api_2_4.xml b/docs/manual/developer/new_api_2_4.xml index 15e98d84c0..0e9c9fbea3 100644 --- a/docs/manual/developer/new_api_2_4.xml +++ b/docs/manual/developer/new_api_2_4.xml @@ -277,14 +277,32 @@

The number of parameters of the ap_log_* functions and the definition of APLOG_MARK has changed. Normally, the change - is completely transparent. However, if a module implements wrapper - functions for ap_log_* and uses APLOG_MARK - when calling these wrappers, some adjustments are necessary. - The easiest way is for the module to define and use a different macro - that expands to the parameters required by the log wrapper functions. - APLOG_MARK should only be used when calling - ap_log_* without additional wrappers. In this way, the - code will remain compatible with HTTPD 2.0 and 2.2.

+ is completely transparent. However, changes are required if a + module uses APLOG_MARK as a parameter to its own functions + or if a module calls ap_log_* without passing + APLOG_MARK. A module which uses wrappers + around ap_log_* typically uses both of these constructs.

+ +

The easiest way to change code which passes APLOG_MARK to + its own functions is to define and use a different macro that expands to + the parameters required by those functions, as APLOG_MARK + should only be used when calling ap_log_* + directly. In this way, the code will remain compatible with HTTPD 2.0 + and 2.2.

+ +

Code which calls ap_log_* without passing + APLOG_MARK will necessarily differ between 2.4 and earlier + releases, as 2.4 requires a new third argument, + APLOG_MODULE_INDEX.

+ + + /* code for httpd 2.0/2.2 */
+ ap_log_perror(file, line, APLOG_ERR, 0, p, "Failed to allocate dynamic lock structure");
+
+ /* code for httpd 2.4 */
+ ap_log_perror(file, line, APLOG_MODULE_INDEX, APLOG_ERR, 0, p, "Failed to allocate dynamic lock structure");
+
+

A server_rec pointer must be passed to ap_log_error() when called after startup. This -- 2.50.1