[core] isolate plugins_*() funcs to main server

(future: might rename plugin.c -> plugins.c since the functions
 contained within are all plugins_*())
master
Glenn Strauss 10 months ago
parent cc65a21e12
commit 96557115cb
  1. 3
      src/CMakeLists.txt
  2. 5
      src/Makefile.am
  3. 3
      src/SConscript
  4. 2
      src/configfile-glue.c
  5. 1
      src/connections.c
  6. 2
      src/h2.c
  7. 2
      src/meson.build
  8. 3
      src/plugin.c
  9. 16
      src/plugin.h
  10. 17
      src/plugin_config.h
  11. 41
      src/plugins.h
  12. 2
      src/reqpool.c
  13. 1
      src/response.c
  14. 1
      src/server.c
  15. 2
      src/status_counter.h

@ -859,7 +859,7 @@ set(COMMON_SRC
base64.c buffer.c burl.c log.c
http_header.c http_kv.c keyvalue.c chunk.c
http_chunk.c fdevent.c fdevent_fdnode.c gw_backend.c
stat_cache.c plugin.c http_etag.c array.c
stat_cache.c http_etag.c array.c
algo_md5.c algo_sha1.c algo_splaytree.c
configfile-glue.c
http-header-glue.c
@ -896,6 +896,7 @@ add_executable(lighttpd
connections.c
h2.c
reqpool.c
plugin.c
sock_addr_cache.c
ls-hpack/lshpack.c
algo_xxhash.c

@ -51,7 +51,7 @@ CLEANFILES = versionstamp.h versionstamp.h.tmp lemon$(BUILD_EXEEXT)
common_src=base64.c buffer.c burl.c log.c \
http_header.c http_kv.c keyvalue.c chunk.c \
http_chunk.c fdevent.c fdevent_fdnode.c gw_backend.c \
stat_cache.c plugin.c http_etag.c array.c \
stat_cache.c http_etag.c array.c \
algo_md5.c algo_sha1.c algo_splaytree.c \
configfile-glue.c \
http-header-glue.c \
@ -66,6 +66,7 @@ common_src=base64.c buffer.c burl.c log.c \
ck.c
src = server.c response.c connections.c h2.c reqpool.c \
plugin.c \
sock_addr_cache.c \
network.c \
network_write.c \
@ -411,7 +412,7 @@ hdr = base64.h buffer.h burl.h network.h log.h http_kv.h keyvalue.h \
http_cgi.h http_date.h \
http_header.h http_range.h \
fdevent.h gw_backend.h connections.h base.h base_decls.h stat_cache.h \
plugin.h plugin_config.h \
plugin.h plugins.h plugin_config.h \
http_etag.h array.h vector.h \
fdevent_impl.h network_write.h configfile.h \
sock_addr_cache.h \

@ -58,7 +58,7 @@ def GatherLibs(env, *libs):
common_src = Split("base64.c buffer.c burl.c log.c \
http_header.c http_kv.c keyvalue.c chunk.c \
http_chunk.c fdevent.c fdevent_fdnode.c gw_backend.c \
stat_cache.c plugin.c http_etag.c array.c \
stat_cache.c http_etag.c array.c \
algo_md5.c algo_sha1.c algo_splaytree.c \
configfile-glue.c \
http-header-glue.c \
@ -74,6 +74,7 @@ common_src = Split("base64.c buffer.c burl.c log.c \
")
src = Split("server.c response.c connections.c h2.c reqpool.c \
plugin.c \
sock_addr_cache.c \
ls-hpack/lshpack.c \
algo_xxhash.c \

@ -13,6 +13,8 @@
#include <string.h>
#include <stdlib.h> /* strtol */
array plugin_stats; /* global */
/**
* like all glue code this file contains functions which
* are the external interface of lighttpd. The functions

@ -17,6 +17,7 @@
#include "stat_cache.h"
#include "plugin.h"
#include "plugins.h"
#include "sock_addr_cache.h"

@ -2544,7 +2544,7 @@ h2_send_end_stream (request_st * const r, connection * const con)
*/
#include "base64.h"
#include "chunk.h"
#include "plugin.h"
#include "plugins.h"
#include "plugin_config.h"
#include "reqpool.h"

@ -775,7 +775,6 @@ common_src = [
'http-header-glue.c',
'keyvalue.c',
'log.c',
'plugin.c',
'rand.c',
'request.c',
'ck.c',
@ -792,6 +791,7 @@ main_src = [
'connections.c',
'data_config.c',
'h2.c',
'plugin.c',
'sock_addr_cache.c',
'ls-hpack/lshpack.c',
'algo_xxhash.c',

@ -1,5 +1,6 @@
#include "first.h"
#include "plugins.h"
#include "plugin.h"
#include "base.h"
#include "array.h"
@ -8,8 +9,6 @@
#include <string.h>
#include <stdlib.h>
array plugin_stats; /* global */
#ifdef HAVE_VALGRIND_VALGRIND_H
# include <valgrind/valgrind.h>
#endif

@ -8,22 +8,6 @@
#include "plugin_config.h"
/**
* The status array can carry all the status information you want
* the key to the array is <module-prefix>.<name>
* and the values are counters
*
* example:
* fastcgi.backends = 10
* fastcgi.active-backends = 6
* fastcgi.backend.<key>.load = 24
* fastcgi.backend.<key>....
*
* fastcgi.backend.<key>.disconnects = ...
*/
extern array plugin_stats;
#define SERVER_FUNC(x) \
static handler_t x(server *srv, void *p_d)

@ -188,4 +188,21 @@ __attribute_cold__
__attribute_pure__
int32_t config_feature_int (const server *srv, const char *feature, int32_t default_value);
/**
* The status array can carry all the status information you want
* the key to the array is <module-prefix>.<name>
* and the values are counters
*
* example:
* fastcgi.backends = 10
* fastcgi.active-backends = 6
* fastcgi.backend.<key>.load = 24
* fastcgi.backend.<key>....
*
* fastcgi.backend.<key>.disconnects = ...
*/
extern array plugin_stats;
#endif

@ -0,0 +1,41 @@
#ifndef INCLUDED_LI_PLUGINS_H
#define INCLUDED_LI_PLUGINS_H
#include "first.h"
#include "base_decls.h"
__attribute_cold__
int plugins_load(server *srv);
__attribute_cold__
void plugins_free(server *srv);
handler_t plugins_call_handle_uri_clean(request_st *r);
handler_t plugins_call_handle_subrequest_start(request_st *r);
handler_t plugins_call_handle_response_start(request_st *r);
handler_t plugins_call_handle_request_env(request_st *r);
handler_t plugins_call_handle_request_done(request_st *r);
handler_t plugins_call_handle_docroot(request_st *r);
handler_t plugins_call_handle_physical(request_st *r);
handler_t plugins_call_handle_request_reset(request_st *r);
handler_t plugins_call_handle_connection_accept(connection *con);
handler_t plugins_call_handle_connection_shut_wr(connection *con);
handler_t plugins_call_handle_connection_close(connection *con);
void plugins_call_handle_trigger(server *srv);
handler_t plugins_call_handle_waitpid(server *srv, pid_t pid, int status);
__attribute_cold__
void plugins_call_handle_sighup(server *srv);
__attribute_cold__
handler_t plugins_call_init(server *srv);
__attribute_cold__
handler_t plugins_call_set_defaults(server *srv);
__attribute_cold__
handler_t plugins_call_worker_init(server *srv);
#endif

@ -13,7 +13,7 @@
#include "base.h"
#include "buffer.h"
#include "chunk.h"
#include "plugin.h"
#include "plugins.h"
#include "plugin_config.h"
#include "request.h"
#include "response.h"

@ -15,6 +15,7 @@
#include "http_range.h"
#include "plugin.h"
#include "plugins.h"
#include <sys/types.h>
#include <sys/stat.h>

@ -14,6 +14,7 @@
#include "sock_addr.h"
#include "stat_cache.h"
#include "plugin.h"
#include "plugins.h"
#include "plugin_config.h" /* config_plugin_value_tobool() */
#include "network_write.h" /* network_write_show_handlers() */
#include "reqpool.h" /* request_pool_init() request_pool_free() */

@ -17,7 +17,7 @@ void status_counter_set(const char *s, size_t len, int val);
/* inline status counter routines */
#include "array.h"
#include "plugin.h"
#include "plugin_config.h"
static inline
int *status_counter_get_counter(const char *s, size_t len) {

Loading…
Cancel
Save