Skip to content

Commit b629398

Browse files
author
Felipe Zimmerle
committed
Adds ap_log_cerror_ to the standalone implementation
1 parent 7bdb79a commit b629398

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

standalone/server.c

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,33 @@ AP_DECLARE(void) ap_log_error_(const char *file, int line, int module_index,
285285
modsecLogHook(modsecLogObj, level, errstr);
286286
}
287287

288+
289+
#if AP_SERVER_MAJORVERSION_NUMBER > 1 && AP_SERVER_MINORVERSION_NUMBER < 3
290+
AP_DECLARE(void) ap_log_cerror(const char *file, int line, int level,
291+
apr_status_t status, const conn_rec *r,
292+
const char *fmt, ...)
293+
// __attribute__((format(printf,6,7)))
294+
#else
295+
AP_DECLARE(void) ap_log_cerror_(const char *file, int line, int module_index,
296+
int level, apr_status_t status,
297+
const conn_rec *c, const char *fmt, ...)
298+
// __attribute__((format(printf,7,8)))
299+
#endif
300+
{
301+
va_list args;
302+
char errstr[MAX_STRING_LEN];
303+
304+
va_start(args, fmt);
305+
306+
apr_vsnprintf(errstr, MAX_STRING_LEN, fmt, args);
307+
308+
va_end(args);
309+
310+
if(modsecLogHook != NULL)
311+
modsecLogHook(modsecLogObj, level, errstr);
312+
}
313+
314+
288315
#if AP_SERVER_MAJORVERSION_NUMBER > 1 && AP_SERVER_MINORVERSION_NUMBER < 3
289316
AP_DECLARE(void) ap_log_rerror(const char *file, int line, int level,
290317
apr_status_t status, const request_rec *r,

0 commit comments

Comments
 (0)