327 Commits (54d7b4677482942b0084bbb8c9bd91faf0798e97)

Author SHA1 Message Date
Stefan Bühler 3bf903c398 [lua] provide and use li_lua_new_protected_metatable to prevent tampering with metatables
Change-Id: Ifda5a1465c8fc291f0f09490a9f6e2c3f6b27504
2 years ago
Stefan Bühler 53337c81d4 [lua] prevent tampering with global "lighty" table
Change-Id: If92ea8d7b58868904ab6d1ffaa27534cb09b7d29
2 years ago
Stefan Bühler 5977493f47 [lua] one li_lua_init_*_mt function per "file", add a few missing ones
Change-Id: I95661db55debe76c0aca99b2920ce202af7d9967
2 years ago
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 505bfb053f [core] move CGI environment creation to core
Change-Id: Ia826381365a04352249321097fda57f704984821
4 years ago
Stefan Bühler d167e6e416 [core/mod_proxy] support http backends trying to run keep-alive
Even if they shouldn't (due to HTTP/1.0 or Connection; close) some
backends send HTTP/1.1 without Connection: close, and use Content-Length
to signal end of response (and don't close the connection, as they wait
for another request).

Now Content-Length is used to find the end of the response (chunked
transfer-encoding was already supported).

mod_proxy now signals HTTP/1.1, but also sends "Connection: close": it
doesn't reuse the connection yet.

Change-Id: Ica0c9b3b7da79899412a746f21e7348ccd3d23ee
4 years ago
Stefan Bühler bda1a90f27 [core] add strict.post_content_length option
Change-Id: Ie9d67eceed7e957b667554925d562018a3217209
5 years ago
Stefan Bühler bc6b256c34 [core] use readdir instead of readdir_r
readdir_r is deprecated in glibc due to serious memory handling issues
in the API: one cannot pass the size of the allocated dirent.

glibc authors claims readdir is thread-safe in modern implementations,
and expect POSIX to require it in a future version.

No way to check whether readdir is thread-safe though :(

("thread-safe" in this context means different directory streams, which
is good enough.)

Also remove li_dirent_buf_size.

Change-Id: Ia5eae3327e97dc4b0751fb2604ea21c0ce09a5f9
6 years ago
Stefan Bühler dca42093b1 [core] disable strict-alias warnings for libev wrappers
Change-Id: I6bea24eb35838e91cc3c3cc6a6f94664c7446533
7 years ago
Stefan Bühler f17a221cd8 use _DEFAULT_SOURCE instead of _BSD_SOURCE
Change-Id: Iecd6f2b4d31cd8f64f1c7ed491650a9b2a35be28
7 years ago
Stefan Bühler f527a16138 [debug] provide more unique event names for waitqueues
Change-Id: Iddf9e10b3902fbfe4fa7e97b7a172018d0d70b54
8 years ago
Stefan Bühler 6b22f2f104 [mod_debug] debug events
Change-Id: Ib776e950902a36f13ed766a78a92f6971310e87d
8 years ago
Stefan Bühler 66bd6b22a2 track event "names" for debugging
Change-Id: Ib8f2b589a6087de2355906a87bd2cd0c84bafcba
9 years ago
Stefan Bühler fc02dcf9e2 [mod_gnutls] improve alert handling
* print alerts with numerical value
* show non-fatal alerts
* use log level info for all alerts
* use log level warning for non-fatal "unknown" errors

Change-Id: Ibaa33743bfe809579981fdeb121955ef5c6d0ab2
9 years ago
Stefan Bühler 72011fbede [mox_rewrite,mod_proxy,docs] fix request.raw_path handling (includes query-string) 9 years ago
Stefan Bühler 4c741ce853 [core] expose request.raw_path as condition variable 9 years ago
Stefan Bühler 8596f874a7 [autobuild] fix duplicate config.h install and remove config.h from dist tarball 9 years ago
Stefan Bühler acd2967534 assert many previously unchecked return values, handle some explicitly, remove FD_CLOEXEC in worker - mustn't fork 9 years ago
Stefan Bühler e0ed289c1a [liValue] fix dereference after NULL check 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 22d186cecc [angel] rewrite config handling, rename items, document it
* remove "instance { ... }" wrapping
  * use "_" instead of "-"
  * modules -> modules_path
  * allow_listen { ip "..."; } -> allow_listen_ip "...";
  * allow_listen { unix "..."; } -> allow_listen_unix "...";
9 years ago
Stefan Bühler 01788a7250 [common] remove hash value type (use key/value lists instead) 9 years ago
Stefan Bühler dfaab291d9 [angel] rewrite parser, changing syntax (similar to main config) 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 9f6d56d5c4 [core] add PACKAGE_NO_BUILD_DATE define to disable PACKAGE_BUILD_DATE 9 years ago
Stefan Bühler 72967a0874 [core] make PACKAGE_BUILD_DATE an embeddable string constant 9 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 b783bd5aaa [misc] use less C99 features 10 years ago
Stefan Bühler 061b2a4262 [core] handle differences between options/actions/setups in plugin.c 10 years ago
Stefan Bühler 92dc237ee8 [core] add li_value_new_hashtable to create a GString -> liValue hashtable 10 years ago
Stefan Bühler 969818083e [core] add li_value_to_key_value_list: convert value hash to key-value list 10 years ago
Stefan Bühler f3436e69f1 [gnutls] fix cleanup order (use-after-free) 10 years ago
Stefan Bühler 45aeb29703 [events] use smaller repeat value to trigger timer "again" (100ms was clearly too large, 0.1ms should do) 10 years ago
Stefan Bühler e762189fb5 [core] only use feature test macros on linux 10 years ago
Stefan Bühler 42ce5eda8f [core] cleanup settings.h - openssl not needed in global headers 10 years ago
Stefan Bühler d0d3dc3c55 define _XOPEN_SOURCE 600 for _POSIX_C_SOURCE 200112L, which should fix IPv6/sockaddr_in6 on BSD 10 years ago
Stefan Bühler 796f6b1547 [mod_gnutls] send alerts instead of aborting, allow safe renegotiations 10 years ago
Stefan Bühler 05e058aa9c fix bugs and warnings reported by clang
* fix memset sizeof() bugs
 * fix unaligned memory access
 * fix warnings for casts with alignment change
 * crypt_r needs _GNU_SOURCE
10 years ago
Stefan Bühler 95f63fc0cf [core] add global named fetch pool; all backends have to return strings. implement a simple backend. 10 years ago
Stefan Bühler 2bcb880dc8 [core] implement generic "fetch" api 10 years ago
Stefan Bühler 97dbcf7e42 [core] add option to disable buffering large request bodies on disk - forward them to backend directly instead
- right now only mod_fastcgi can handle this (it won't set the CONTENT_LENGTH env var, the backend
    has to support this too)
10 years ago
Stefan Bühler 38aad8128e [angel,tests] implement and use "one-shot" option to not restart crashed workers 10 years ago
Stefan Bühler 64cabac477 [core] fix connection timeout handling 10 years ago
Stefan Bühler 5e4a94b0c6 [core] handle Connection: Upgrade 10 years ago
Stefan Bühler 3deb7c9e79 [core] support chunked uploads 10 years ago
Stefan Bühler 0857befb7f fix handling of new connection state 10 years ago
Stefan Bühler bf6470375a flush sockets after request end by setting TCP_NODELY temporarily 10 years ago
Stefan Bühler 11b4bdd8c5 replace unneeded ev_/EV_ references 10 years ago
Stefan Bühler 709296d796 fix bugs and warnings from compiler warnings (memset parameter order, shadow, ...) 10 years ago