[core] struct plugin_data_base

personal/stbuehler/ci-build
Glenn Strauss 4 years ago
parent be04c1239f
commit b2b41e36e3

@ -37,10 +37,6 @@
#define connection_set_state(con, n) ((con)->state = (n))
typedef struct {
PLUGIN_DATA;
} plugin_data;
__attribute_cold__
static connection *connection_init(server *srv);
@ -111,7 +107,7 @@ static void connection_plugin_ctx_check(server *srv, connection *con) {
/* plugins should have cleaned themselves up */
for (uint32_t i = 0; i < srv->plugins.used; ++i) {
plugin *p = ((plugin **)(srv->plugins.ptr))[i];
plugin_data *pd = p->data;
plugin_data_base *pd = p->data;
if (!pd || NULL == con->plugin_ctx[pd->id]) continue;
log_error_write(srv, __FILE__, __LINE__, "ss",
"missing cleanup in", p->name);

@ -24,10 +24,6 @@
*
*/
typedef struct {
PLUGIN_DATA;
} plugin_data;
typedef enum {
PLUGIN_FUNC_HANDLE_URI_CLEAN,
PLUGIN_FUNC_HANDLE_URI_RAW,
@ -282,7 +278,7 @@ int plugins_load(server *srv) {
typedef struct {
handler_t(*fn)();
void *data;
plugin_data_base *data;
} plugin_fn_data;
__attribute_hot__
@ -406,7 +402,7 @@ handler_t plugins_call_init(server *srv) {
}
/* used for con->mode, DIRECT == 0, plugins above that */
((plugin_data *)(p->data))->id = i + 1;
((plugin_data_base *)(p->data))->id = i + 1;
if (p->version != LIGHTTPD_VERSION_ID) {
log_error_write(srv, __FILE__, __LINE__, "ss",

@ -29,6 +29,10 @@
#define PLUGIN_DATA int id; int nconfig
typedef struct {
PLUGIN_DATA;
} plugin_data_base;
typedef struct {
void *data;
/* is called ... */

Loading…
Cancel
Save