summaryrefslogtreecommitdiff
path: root/src/plugin.h
diff options
context:
space:
mode:
authorGlenn Strauss <gstrauss@gluelogic.com>2019-10-19 00:30:54 -0400
committerGlenn Strauss <gstrauss@gluelogic.com>2020-05-23 17:59:29 -0400
commite2de4e581ec7a61fd9f5218f260d3890837e31a4 (patch)
tree1b3a143b871afa3140d3876a6628b035079ef9db /src/plugin.h
parent2c43ae73dd8e8c475fcd578d4bcdf6fccfadb59c (diff)
downloadlighttpd-git-e2de4e581ec7a61fd9f5218f260d3890837e31a4.tar.gz
[core] const char *name in struct plugin
put void *data (always used) as first member of struct plugin add int nconfig member to PLUGIN_DATA calloc() inits p->data to NULL
Diffstat (limited to 'src/plugin.h')
-rw-r--r--src/plugin.h41
1 files changed, 16 insertions, 25 deletions
diff --git a/src/plugin.h b/src/plugin.h
index 03864b2c..889ad9d4 100644
--- a/src/plugin.h
+++ b/src/plugin.h
@@ -27,23 +27,11 @@
#define REQUESTDONE_FUNC CONNECTION_FUNC
#define URIHANDLER_FUNC CONNECTION_FUNC
-#define PLUGIN_DATA size_t id
+#define PLUGIN_DATA int id; int nconfig
typedef struct {
- size_t version;
-
- buffer *name; /* name of the plugin */
-
- void *(* init) ();
- handler_t (* priv_defaults) (server *srv, void *p_d);
- handler_t (* set_defaults) (server *srv, void *p_d);
- handler_t (* worker_init) (server *srv, void *p_d); /* at server startup (each worker after fork()) */
- handler_t (* cleanup) (server *srv, void *p_d);
+ void *data;
/* is called ... */
- handler_t (* handle_trigger) (server *srv, void *p_d); /* once a second */
- handler_t (* handle_sighup) (server *srv, void *p_d); /* at a sighup */
- handler_t (* handle_waitpid) (server *srv, void *p_d, pid_t pid, int status); /* upon a child process exit */
-
handler_t (* handle_uri_raw) (server *srv, connection *con, void *p_d); /* after uri_raw is set */
handler_t (* handle_uri_clean) (server *srv, connection *con, void *p_d); /* after uri is set */
handler_t (* handle_docroot) (server *srv, connection *con, void *p_d); /* getting the document-root */
@@ -53,21 +41,24 @@ typedef struct {
handler_t (* handle_connection_accept) (server *srv, connection *con, void *p_d); /* after accept() socket */
handler_t (* handle_connection_shut_wr)(server *srv, connection *con, void *p_d); /* done writing to socket */
handler_t (* handle_connection_close) (server *srv, connection *con, void *p_d); /* before close() of socket */
-
-
-
- handler_t (* handle_subrequest_start)(server *srv, connection *con, void *p_d);
-
- /* when a handler for the request
- * has to be found
- */
+ handler_t (* handle_subrequest_start)(server *srv, connection *con, void *p_d); /* when handler for request not found yet */
handler_t (* handle_subrequest) (server *srv, connection *con, void *p_d); /* */
handler_t (* handle_response_start) (server *srv, connection *con, void *p_d); /* before response headers are written */
handler_t (* connection_reset) (server *srv, connection *con, void *p_d); /* after request done or request abort */
- void *data;
- /* dlopen handle */
- void *lib;
+ handler_t (* handle_trigger) (server *srv, void *p_d); /* once a second */
+ handler_t (* handle_sighup) (server *srv, void *p_d); /* at a sighup */
+ handler_t (* handle_waitpid) (server *srv, void *p_d, pid_t pid, int status); /* upon a child process exit */
+
+ void *(* init) ();
+ handler_t (* priv_defaults) (server *srv, void *p_d);
+ handler_t (* set_defaults) (server *srv, void *p_d);
+ handler_t (* worker_init) (server *srv, void *p_d); /* at server startup (each worker after fork()) */
+ handler_t (* cleanup) (server *srv, void *p_d);
+
+ const char *name;/* name of the plugin */
+ size_t version;
+ void *lib; /* dlopen handle */
} plugin;
__attribute_cold__