Fork 0
Commit Graph

64 Commits

Author SHA1 Message Date
Stefan Bühler 5f4019359e [config parser] copy fixes from angel config parser 2014-04-15 12:41:09 +02:00
Stefan Bühler 17a5168793 [core] convert all assert() to LI_FORCE_ASSERT(), and support writing backtraces on fatal errors with libunwind 2014-04-11 11:40:24 +02:00
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
2014-02-10 15:33:48 +01:00
Stefan Bühler db58828e0b [common] refactor liValue to share most of the code
* removing unused "range" value type in angel
2014-02-06 14:01:20 +01:00
Stefan Bühler f482877825 [doc] document core config and modules in tree 2014-02-03 12:57:25 +01:00
Stefan Bühler a6303d8baa [config] allow setting vars in setup block 2013-11-13 23:49:08 +01:00
Stefan Bühler 0d40b25d19 [config] fix missing reference (segfault on shutdown) 2013-09-10 16:05:13 +02:00
Stefan Bühler 7d22354772 [config] fix cast(string) 2013-09-10 15:22:58 +02:00
Stefan Bühler 56e606bbd7 [config] setup only allowed in master config context 2013-09-10 12:07:04 +02:00
Stefan Bühler e55f423203 [config] fix more bugs in new config handling 2013-09-09 13:10:50 +02:00
Stefan Bühler e4c99e55d6 [config] fix bug in config parser (failed parsing names followed by a comma) 2013-09-09 12:09:22 +02:00
Stefan Bühler 4056bd1a43 [config] fix mem leaks in config parser 2013-09-09 10:30:07 +02:00
Stefan Bühler 875995dae5 [config] fix bugs in new config handling 2013-09-09 10:17:43 +02:00
Stefan Bühler 8037af605f replace g_hash_table_contains with g_hash_table_lookup 2013-09-06 17:11:14 +02:00
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
2013-09-06 16:43:26 +02:00
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)
2013-09-06 14:36:55 +02:00
Stefan Bühler 061b2a4262 [core] handle differences between options/actions/setups in plugin.c 2013-08-22 18:02:50 +02:00
Stefan Bühler 0d85a068c8 [lua] add per lua_State lock 2013-05-04 13:11:25 +02:00
Stefan Bühler 97bc95a107 [configparser] allow normal actions and setups with the same name 2012-03-17 12:42:55 +01:00
Thomas Porzelt a66b6ce8d5 [config parser] rename 'o' liValue variables to 'v'. the name was a relict from option variables 2011-11-26 15:20:40 +01:00
Thomas Porzelt 9f17fd620d [config parser] add 'none' and 'default' keywords 2011-11-26 15:11:39 +01:00
Thomas Porzelt cc1c9a92e2 [config parser] don't allow setup blocks or includes in setup blocks 2011-08-28 15:07:23 +02:00
Thomas Porzelt 2ebf367df5 [config parser] fix detection of conflicts between options and uservars 2011-08-28 14:17:47 +02:00
Thomas Porzelt 04c8356b44 [config parser] change syntax again: user defined variables are now defined as 'x = ...;'. user defined actions are not special anymore 2011-08-28 11:30:35 +02:00
Stefan Bühler abd58794d8 [config parser]: fix crash with nested conditional blocks, fix some warnings 2011-08-25 19:57:08 +02:00
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
2011-08-20 11:43:02 +02:00
Stefan Bühler 11fa781f98 Fix some warnings found with clang analyzer 2010-10-07 18:31:21 +02:00
Thomas Porzelt efb04f1f13 [config parser] include: Log warning if no file matches wildcard, error if no wildcard and file not found 2010-09-25 15:55:31 +02:00
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 2010-09-19 13:12:02 +02:00
Stefan Bühler b8a0921265 Add some missing LI_/li prefixes for types and enum values 2010-08-19 17:24:07 +02:00
Stefan Bühler 7bb671de4c [config parser] fix operators 2010-08-09 00:16:13 +02:00
Stefan Bühler 8b17198eb6 Try to fix some bugs in the config parser 2010-08-08 23:36:20 +02:00
Thomas Porzelt 2885c88ae7 [core] Config parser: one more fix for condition parsing 2010-08-08 21:53:21 +02:00
Thomas Porzelt 5b9cc67ad5 [core] Config parser: fix a whitespace handling bug 2010-08-08 14:21:36 +02:00
Thomas Porzelt 7648ef0f40 [core] Config parser: Fix parsing rules for multiple else-if conditions 2010-08-08 01:05:46 +02:00
Thomas Porzelt 45d9fda41e [core] Config parser: fix condition with key handling 2010-08-08 00:27:01 +02:00
Thomas Porzelt ab94d8390d [core] Change *bit integer suffixes in config parser 2010-08-04 22:04:00 +02:00
Thomas Porzelt 5f655d3b6e [core] Fix 'else if' handling in config parser 2010-08-04 21:19:32 +02:00
Thomas Porzelt 65a3d5dfa9 [core] Add support for 'and' and 'or' in conditions to the config parser 2010-08-03 22:03:14 +02:00
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
2010-05-07 20:54:50 +02:00
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 2010-02-21 14:32:58 +01:00
Stefan Bühler e0370fac79 Fix some lua handling; add args for lua plugins/handlers 2010-02-14 15:48:25 +01:00
Thomas Porzelt fc09bf9095 [core] Don't allow spaces between integer value and its suffix, was not deterministic 2010-02-13 13:25:16 +01:00
Stefan Bühler 64c2fece96 config: add network cidr matching operators, =/ and != 2010-01-27 22:05:06 +01:00
Stefan Bühler 64ba5fddce Cleanup value pointer extractions 2010-01-24 23:00:48 +01:00
Stefan Bühler 3bc425fef1 Remove config parser code from main(), add cmake-option to disable default config parser 2009-12-13 21:35:46 +01:00
Stefan Bühler eff8ed5e50 Add request.environment[] conditional 2009-12-13 00:36:56 +01:00
Thomas Porzelt 9989cd62ce [core] Fix value statements in config parser (now using stack for operator) 2009-11-21 16:36:42 +01:00
Stefan Bühler d9228f3ef0 Add per worker lua_State 2009-11-01 15:43:12 +01:00
Stefan Bühler a151eeac2f Prefix li_ cleanup, verified with nm -g --defined-only 2009-10-09 15:38:12 +02:00