From 29326d6a19f2045521e9d8f3a3be37c3363739eb Mon Sep 17 00:00:00 2001 From: Mark Donnelly Date: Fri, 5 Sep 2014 11:40:44 -0400 Subject: [PATCH] Compatibility with both Apache 2.2 and 2.4. The ap_log_rerror function has changed the parameters that it accepts between Apache 2.2 and 2.4. The gss_log function wraps around ap_log_rerror, so it needs to deal with the new parameter that was added. --- gss.c | 22 +++++++++++++++++++--- gss.h | 11 +++++++++-- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/gss.c b/gss.c index 9ecee1c..cab10c3 100644 --- a/gss.c +++ b/gss.c @@ -32,8 +32,15 @@ #include "mod_auth_gssapi.h" void -gss_log(const char *file, int line, int level, int status, - const request_rec *r, const char *fmt, ...) +gss_log(const char *file, + int line, +#if AP_SERVER_MAJORVERSION_NUMBER == 2 && AP_SERVER_MINORVERSION_NUMBER == 4 + int module_index, +#endif + int level, + int status, + const request_rec *r, + const char *fmt, ...) { char errstr[1024]; va_list ap; @@ -42,7 +49,16 @@ gss_log(const char *file, int line, int level, int status, vsnprintf(errstr, sizeof(errstr), fmt, ap); va_end(ap); - ap_log_rerror(file, line, level | APLOG_NOERRNO, status, r, "%s", errstr); + ap_log_rerror(file, + line, +#if AP_SERVER_MAJORVERSION_NUMBER == 2 && AP_SERVER_MINORVERSION_NUMBER == 4 + module_index, +#endif + level | APLOG_NOERRNO, + status, + r, + "%s", + errstr); } apr_status_t diff --git a/gss.h b/gss.h index 4aa2885..4c01355 100644 --- a/gss.h +++ b/gss.h @@ -72,8 +72,15 @@ typedef struct gss_conn_ctx_t { } *gss_conn_ctx; void -gss_log(const char *file, int line, int level, int status, - const request_rec *r, const char *fmt, ...); +gss_log(const char *file, + int line, +#if AP_SERVER_MAJORVERSION_NUMBER == 2 && AP_SERVER_MINORVERSION_NUMBER == 4 + int module_index, +#endif + int level, + int status, + const request_rec *r, + const char *fmt, ...); apr_status_t gss_cleanup_conn_ctx(void *data); -- 2.1.4