67 Commits (53337c81d40b90d3f8daab92c8419522d3a1c0fc)

Author SHA1 Message Date
Stefan Bühler 4a4fd8fd11 [core] include and use hedley (v15) header
hedley is a single header to handle compiler-specific features:
https://nemequ.github.io/hedley/

Prefer headly macros over glib for now.

Change-Id: I3c67ebee0d43e27fde6402d47788e1045144e864
2 years ago
Stefan Bühler 6a0e57ec8f [parsers] fix unused variable warnings
Change-Id: Ifc0210235ada102e2dbcba23e1179e87b973510f
7 years ago
Stefan Bühler 130f14a3ea [config] expect exactly one comma between list entries
- the parser didn't require a comma before, and accepted multiple ones
- comma at end of list still optional

Change-Id: I4bb07ceed9aaceb43a14f7eeb5d364d6718e7acc
8 years ago
Stefan Bühler 5f4019359e [config parser] copy fixes from angel config parser 9 years ago
Stefan Bühler 17a5168793 [core] convert all assert() to LI_FORCE_ASSERT(), and support writing backtraces on fatal errors with libunwind 9 years ago
Stefan Bühler ec6600271a [config] fix conditional parsing
conditional expressions include values to compare with; any
  complicated value expression must be put into parantheses.
  -> stop parsing after a simple value, don't search for operators,
     "and"/"or" operators are handled by the conditional
9 years ago
Stefan Bühler db58828e0b [common] refactor liValue to share most of the code
* removing unused "range" value type in angel
9 years ago
Stefan Bühler f482877825 [doc] document core config and modules in tree 9 years ago
Stefan Bühler a6303d8baa [config] allow setting vars in setup block 10 years ago
Stefan Bühler 0d40b25d19 [config] fix missing reference (segfault on shutdown) 10 years ago
Stefan Bühler 7d22354772 [config] fix cast(string) 10 years ago
Stefan Bühler 56e606bbd7 [config] setup only allowed in master config context 10 years ago
Stefan Bühler e55f423203 [config] fix more bugs in new config handling 10 years ago
Stefan Bühler e4c99e55d6 [config] fix bug in config parser (failed parsing names followed by a comma) 10 years ago
Stefan Bühler 4056bd1a43 [config] fix mem leaks in config parser 10 years ago
Stefan Bühler 875995dae5 [config] fix bugs in new config handling 10 years ago
Stefan Bühler 8037af605f replace g_hash_table_contains with g_hash_table_lookup 10 years ago
Stefan Bühler e76ebe2021 [core] rewrite config parser
* no more hash values - only lists and list of key-value pairs
 * "master" config:
   the config loaded on startup can use all features,
   configs loaded later (vhost on demand from sql...) can't use
   include* and cannot modify global vars.
 * scoped variables
   - add a global var store in the server struct
   - global vars can be set with "global foo = bar"
   - if a variable already exists in a scope it will be modified on a
	 write, otherwise a new local variable is created
   - global vars won't be modified if not in "master" mode
   - vars can be made explicitly local with "local foo = bar"; create a
	 local copy with "local foo = foo"
   - globals vars are available in live config loads for reading
   - each file and action block {...} creates a new scope; if/else branches do
	 NOT create a new scope
 * to append a value to a list use "l + [v]" (not "l + v" anymore);
   lists are concatenated with "+"
 * [...] always marks a list
 * (...) is a list if it contains a "," or "=>", otherwise it justs
   groups an expression
 * a list can either contain key-value pairs or other values. mixing is
   not allowed
10 years ago
Stefan Bühler a1fbaab86b [core/modules] refactor config handling
* should be more robust now: taking list of wanted value, handling NULL
   pointers instead of value type NONE, fixed some bugs (wrong checks,
   mem leaks, ...)
 * add many methods to make handling of values easier; most methods
   can handle NULL value pointers safely (li_value_type(v) instead of
   v->type and so on)
10 years ago
Stefan Bühler 061b2a4262 [core] handle differences between options/actions/setups in plugin.c 10 years ago
Stefan Bühler 0d85a068c8 [lua] add per lua_State lock 10 years ago
Stefan Bühler 97bc95a107 [configparser] allow normal actions and setups with the same name 11 years ago
Thomas Porzelt a66b6ce8d5 [config parser] rename 'o' liValue variables to 'v'. the name was a relict from option variables 12 years ago
Thomas Porzelt 9f17fd620d [config parser] add 'none' and 'default' keywords 12 years ago
Thomas Porzelt cc1c9a92e2 [config parser] don't allow setup blocks or includes in setup blocks 12 years ago
Thomas Porzelt 2ebf367df5 [config parser] fix detection of conflicts between options and uservars 12 years ago
Thomas Porzelt 04c8356b44 [config parser] change syntax again: user defined variables are now defined as 'x = ...;'. user defined actions are not special anymore 12 years ago
Stefan Bühler abd58794d8 [config parser]: fix crash with nested conditional blocks, fix some warnings 12 years ago
Thomas Porzelt 9f832c75ea Config syntax changes and parser fixes:
* Change ":" to "=>" in hash tables
* Change assignments to not need "=" anymore
* User defined actions must now be prefixed with the "action" keyword
* Anonymous user defined actions don't need the "$" prefix anymore
* Fix parsing of conditionals with more than 2 conditions
12 years ago
Stefan Bühler 11fa781f98 Fix some warnings found with clang analyzer 13 years ago
Thomas Porzelt efb04f1f13 [config parser] include: Log warning if no file matches wildcard, error if no wildcard and file not found 13 years ago
Thomas Porzelt d0ae21c7b2 [config parser] Rename var.PID/var.CWD/env.* to sys.pid/sys.cwd/sys.env.* and add sys.version containing the lighty version 13 years ago
Stefan Bühler b8a0921265 Add some missing LI_/li prefixes for types and enum values 13 years ago
Stefan Bühler 7bb671de4c [config parser] fix operators 13 years ago
Stefan Bühler 8b17198eb6 Try to fix some bugs in the config parser 13 years ago
Thomas Porzelt 2885c88ae7 [core] Config parser: one more fix for condition parsing 13 years ago
Thomas Porzelt 5b9cc67ad5 [core] Config parser: fix a whitespace handling bug 13 years ago
Thomas Porzelt 7648ef0f40 [core] Config parser: Fix parsing rules for multiple else-if conditions 13 years ago
Thomas Porzelt 45d9fda41e [core] Config parser: fix condition with key handling 13 years ago
Thomas Porzelt ab94d8390d [core] Change *bit integer suffixes in config parser 13 years ago
Thomas Porzelt 5f655d3b6e [core] Fix 'else if' handling in config parser 13 years ago
Thomas Porzelt 65a3d5dfa9 [core] Add support for 'and' and 'or' in conditions to the config parser 13 years ago
Stefan Bühler a8efcfcc0e modify plugin api to include worker context for action/option parsing; add per-worker callback for stop_worker
* create main_worker earlier
13 years ago
Thomas Porzelt 5892c78e7d [core] Support req. phys. and resp. abbreviations in li_cond_lvalue_from_string() and make config parser use this function instead of own code 13 years ago
Stefan Bühler e0370fac79 Fix some lua handling; add args for lua plugins/handlers 13 years ago
Thomas Porzelt fc09bf9095 [core] Don't allow spaces between integer value and its suffix, was not deterministic 14 years ago
Stefan Bühler 64c2fece96 config: add network cidr matching operators, =/ and != 14 years ago
Stefan Bühler 64ba5fddce Cleanup value pointer extractions 14 years ago
Stefan Bühler 3bc425fef1 Remove config parser code from main(), add cmake-option to disable default config parser 14 years ago
Stefan Bühler eff8ed5e50 Add request.environment[] conditional 14 years ago