Add the ability to build custom request body parser extensions.

Add an example for a request body parser extension.
This commit is contained in:
b1v1r
2010-05-05 23:01:11 +00:00
parent f7f305991f
commit 058283fb5a
9 changed files with 334 additions and 22 deletions

View File

@@ -1116,6 +1116,25 @@ static void modsec_register_variable(const char *name, unsigned int type,
fprintf(stderr,"modsecurity is NULL\n");
}
}
/**
* This function is exported for other Apache modules to
* register new request body processors.
*/
static void modsec_register_reqbody_processor(const char *name,
void *fn_init,
void *fn_process,
void *fn_complete)
{
if (modsecurity != NULL) {
msre_engine_reqbody_processor_register(modsecurity->msre, name,
(fn_reqbody_processor_init_t)fn_init,
(fn_reqbody_processor_init_t)fn_process,
(fn_reqbody_processor_init_t)fn_complete);
}
}
#endif
/**
@@ -1168,6 +1187,7 @@ static void register_hooks(apr_pool_t *mp) {
APR_REGISTER_OPTIONAL_FN(modsec_register_tfn);
APR_REGISTER_OPTIONAL_FN(modsec_register_operator);
APR_REGISTER_OPTIONAL_FN(modsec_register_variable);
APR_REGISTER_OPTIONAL_FN(modsec_register_reqbody_processor);
#endif
/* Main hooks */