Browse Source

[core] store (plugin *) in p->data

(self-referential)
personal/stbuehler/ci-build
Glenn Strauss 2 years ago
parent
commit
eea7cd3c2f
  1. 3
      src/base_decls.h
  2. 2
      src/plugin.c
  3. 7
      src/plugin.h

3
src/base_decls.h

@ -9,6 +9,9 @@ typedef struct server server;
struct connection;
typedef struct connection connection;
struct plugin;
typedef struct plugin plugin;
struct request_st;
typedef struct request_st request_st;

2
src/plugin.c

@ -435,7 +435,7 @@ handler_t plugins_call_init(server *srv) {
return HANDLER_ERROR;
}
/* used for con->mode, DIRECT == 0, plugins above that */
((plugin_data_base *)(p->data))->self = p;
((plugin_data_base *)(p->data))->id = i + 1;
if (p->version != LIGHTTPD_VERSION_ID) {

7
src/plugin.h

@ -49,13 +49,14 @@ extern array plugin_stats;
#define PLUGIN_DATA int id; \
int nconfig; \
config_plugin_value_t *cvlist
config_plugin_value_t *cvlist; \
struct plugin *self
typedef struct {
PLUGIN_DATA;
} plugin_data_base;
typedef struct {
struct plugin {
void *data;
/* is called ... */
handler_t (* handle_uri_raw) (connection *con, void *p_d); /* after uri_raw is set */
@ -85,7 +86,7 @@ typedef struct {
const char *name;/* name of the plugin */
size_t version;
void *lib; /* dlopen handle */
} plugin;
};
__attribute_cold__
int plugins_load(server *srv);

Loading…
Cancel
Save