Browse Source

add variable var.PID for use in config file

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@698 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.6
Xuefer 17 years ago
parent
commit
3006dd11c5
  1. 1
      doc/configuration.txt
  2. 5
      src/configfile.c

1
doc/configuration.txt

@ -57,6 +57,7 @@ Example
# variables, computed when config is read.
var.mymodule = "foo"
server.modules += ( "mod_" + var.mymodule )
var.PID is initized to the pid of lighttpd before config is parsed
# include, relative to dirname of main config file
include "mime.types.conf"

5
src/configfile.c

@ -900,6 +900,7 @@ static void context_free(config_t *context) {
int config_read(server *srv, const char *fn) {
config_t context;
data_config *dc;
data_integer *dpid;
int ret;
char *pos;
data_array *modules;
@ -929,6 +930,10 @@ int config_read(server *srv, const char *fn) {
/* default context */
srv->config = dc->value;
dpid = data_integer_init();
dpid->value = getpid();
buffer_copy_string(dpid->key, "var.PID");
array_insert_unique(srv->config, (data_unset *)dpid);
ret = config_parse_file(srv, &context, fn);

Loading…
Cancel
Save