Commit Graph

28 Commits

Author SHA1 Message Date
Glenn Strauss e5e5548b88 [mod_extforward] reset cond_cache for scheme (fixes #1499)
bug #1499 was mostly fixed in 05858f6c
This patch additionally resets the cond_cache since scheme might change

x-ref:
  "HTTPS env var should be "on" when using mod_extforward and the X-Forwarded-Proto header is set."
  https://redmine.lighttpd.net/issues/1499
2016-04-13 00:17:46 -04:00
Glenn Strauss 8abd06a7ff consistent inclusion of config.h at top of files (fixes #2073)
From: Glenn Strauss <gstrauss@gluelogic.com>

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@3113 152afb58-edef-0310-8abb-c4023f1b3aa9
2016-03-19 15:14:35 +00:00
Stefan Bühler c512345fa2 [config] check config option scope; warn if server option is given in conditional
From: Stefan Bühler <stbuehler@web.de>

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@3049 152afb58-edef-0310-8abb-c4023f1b3aa9
2015-11-07 12:51:11 +00:00
Stefan Bühler 71b5c53a0a show extforward re-run warning only with debug.log-request-handling (fixes #2561)
From: Stefan Bühler <stbuehler@web.de>

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2993 152afb58-edef-0310-8abb-c4023f1b3aa9
2015-07-05 16:48:27 +00:00
Stefan Bühler 33cebeb0f7 fix segfaults in many plugins if they failed configuration
From: Stefan Bühler <stbuehler@web.de>

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2988 152afb58-edef-0310-8abb-c4023f1b3aa9
2015-05-14 09:38:33 +00:00
Stefan Bühler ad3e93ea96 Use buffer API to read and modify "used" member
- a lot of code tried to handle manually adding terminating zeroes and
  keeping track of the correct "used" count.
  Replaced all "external" usages with simple wrapper functions:
  * buffer_string_is_empty (used <= 1), buffer_is_empty (used == 0);
    prefer buffer_string_is_empty
  * buffer_string_set_length
  * buffer_string_length
  * CONST_BUF_LEN() macro
- removed "static" buffer hacks (buffers pointing to constant/stack
  memory instead of malloc()ed data)
- buffer_append_strftime(): refactor buffer+strftime uses
- li_tohex(): no need for a buffer for binary-to-hex conversion:
  the output data length is easy to predict
- remove "-Winline" from extra warnings: the "inline" keyword just
  supresses the warning about unused but defined (static) functions;
  don't care whether it actually gets inlined or not.

From: Stefan Bühler <stbuehler@web.de>

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2979 152afb58-edef-0310-8abb-c4023f1b3aa9
2015-02-08 19:10:44 +00:00
Stefan Bühler 07dd0bd0a5 add force_assert() to enforce assertions as simple assert()s are disabled by -DNDEBUG (fixes #2546)
From: Stefan Bühler <stbuehler@web.de>

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2948 152afb58-edef-0310-8abb-c4023f1b3aa9
2014-02-16 13:08:20 +00:00
Stefan Bühler 6f208cfde1 fix/silence bugs reported by ccc-analyzer (clang)
These should all be non critical:
 * memory leaks on startup in error cases (which lead to
   immediate shutdowns anyway)
 * http_auth/ldap: passing uninitialized "ret" to ldap_err2string
 * sizeof(T) not matching the target pointer in malloc/calloc calls;
   those cases were either:
   * T being the wrong pointer type - shouldn't matter as long as all
     pointers have same size
   * T being larger than the type needed
 * mod_accesslog: direct use after free in cleanup (server shutdown);
   could crash before "clean" shutdown
 * some false positives (mod_compress, mod_expire)
 * assert(srv->config_context->used > 0); - this is always the case,
   as there is always a global config block

From: Stefan Bühler <stbuehler@web.de>

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2920 152afb58-edef-0310-8abb-c4023f1b3aa9
2013-11-13 11:43:26 +00:00
Stefan Bühler 268c054c40 [mod_extforward] fix compilation without IPv6, (not) using undefined var (fixes #2515, thx mm)
From: Stefan Bühler <stbuehler@web.de>

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2911 152afb58-edef-0310-8abb-c4023f1b3aa9
2013-10-13 11:34:55 +00:00
Stefan Bühler 05858f6cf2 [ssl] Fix $HTTP["scheme"] conditional, could be "http" for ssl connections if the ssl $SERVER["socket"] conditional was nested (fixes #2501)
con->conf.is_ssl got removed and replaced by:
 * con->conf.ssl_enabled for the config var "ssl.engine" - it is only
   used to determine which server-sockets should use ssl. (usually not
   needed as it is mandatory and enough to set ssl.pemfile anyway)
 * con->srv_socket->is_ssl to detect the actual ssl status of the
   bound socket, which is the same as the ssl status of the connection
 * con->uri.scheme for the actual $HTTP["scheme"] value, also used for
   the CGI "HTTPS=ON" variable. This defaults to "https" if the
   connection uses ssl, but can be changed for example by mod_extforward
   if X-Forwarded-Proto: is set to either "http" or "https" (other values
   are ignored right now)

Also removed the broken srv_socket->is_proxy_ssl as it was a connection
value in a server_socket struct...

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2887 152afb58-edef-0310-8abb-c4023f1b3aa9
2013-07-31 20:23:21 +00:00
Stefan Bühler a0e93c678b fix undefined stuff found with clang
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2873 152afb58-edef-0310-8abb-c4023f1b3aa9
2013-05-15 10:31:09 +00:00
Stefan Bühler 29b126d5d3 mod_extforward: log address of untrusted proxy with debug.log-request-handling
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2858 152afb58-edef-0310-8abb-c4023f1b3aa9
2012-11-15 08:44:10 +00:00
Cyril Brulebois 9c43331382 Use NULL instead of 0 where pointers are expected.
There are 6 remaining occurrences after this commit, in mod_compress,
due to zlib's Z_NULL being defined as 0 instead of NULL.

Signed-off-by: Cyril Brulebois <kibi@debian.org>

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2845 152afb58-edef-0310-8abb-c4023f1b3aa9
2012-08-31 14:11:43 +00:00
Stefan Bühler 1ee35acc6f [mod_extforward] Support ipv6 addresses (fixes #1889)
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2837 152afb58-edef-0310-8abb-c4023f1b3aa9
2012-05-18 13:28:00 +00:00
Stefan Bühler 38f2d1ddd7 cleanup fdevent code, removed linux-rtsig handler, replaced some fprintf calls
* use log functions
 * convert flags
 * fix handler callback prototype

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2752 152afb58-edef-0310-8abb-c4023f1b3aa9
2010-08-06 21:57:15 +00:00
Stefan Bühler 22e8b456a9 Fix header inclusion order, always include "config.h" before any system header
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2624 152afb58-edef-0310-8abb-c4023f1b3aa9
2009-10-11 14:31:42 +00:00
Stefan Bühler d0c8721b0d Fix unused var in mod_extforward if ipv6 is disabled.
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2487 152afb58-edef-0310-8abb-c4023f1b3aa9
2009-04-27 09:28:49 +00:00
Stefan Bühler 4c7c0b815e Make mod_extforward headers configurable (fixes #1545)
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2482 152afb58-edef-0310-8abb-c4023f1b3aa9
2009-04-26 19:43:22 +00:00
Stefan Bühler 63f785a2f8 Added some extra warning options in cmake and fix the resulting warnings (unused/static functions)
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2414 152afb58-edef-0310-8abb-c4023f1b3aa9
2009-03-07 21:05:37 +00:00
Stefan Bühler 2772e62d8d Fix mod_extforward to compile with old gcc version (#1591)
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2129 152afb58-edef-0310-8abb-c4023f1b3aa9
2008-03-13 15:34:28 +00:00
Stefan Bühler 85b8153dfc Fix previous merge
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2113 152afb58-edef-0310-8abb-c4023f1b3aa9
2008-03-02 12:59:18 +00:00
Elan Ruusamäe cde46f6a3d - support chained proxies in mod_extforward (#1528)
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2061 152afb58-edef-0310-8abb-c4023f1b3aa9
2008-01-21 08:21:20 +00:00
Elan Ruusamäe af4be7d0ce - HTTPS env var should be "on" when using mod_extforward and the X-Forwarded-Proto header is set. (#1499)
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2052 152afb58-edef-0310-8abb-c4023f1b3aa9
2008-01-18 09:07:54 +00:00
Jan Kneschke f978d992df use public API instead of patching the cond-cache ourself
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@1943 152afb58-edef-0310-8abb-c4023f1b3aa9
2007-08-18 09:43:35 +00:00
Jan Kneschke 3940c60e68 fixed aggressive caching of conditionals (#41)
$HTTP["url"] =~ "" { cgi.assign = ... } fails if there is a module
loaded which is called before uri_clean is set (mod_exforward,
mod_rewrite, ...) 

- merged [1792], [1798], [1807], [1810], [1811] from trunk


git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@1942 152afb58-edef-0310-8abb-c4023f1b3aa9
2007-08-18 09:27:11 +00:00
Jan Kneschke fb816f768b oops, missed one renamed variable if IPv6 is not available
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@1738 152afb58-edef-0310-8abb-c4023f1b3aa9
2007-04-10 09:26:20 +00:00
Jan Kneschke 7f5aabdaaf * fixed possible crash in debug-message in mod_extforward
* fixed compilation of mod_extforward on glibc < 2.3.4



git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@1736 152afb58-edef-0310-8abb-c4023f1b3aa9
2007-04-10 08:47:30 +00:00
Elan Ruusamäe f68fd405f4 - add mod_extforward module from wiki
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@1665 152afb58-edef-0310-8abb-c4023f1b3aa9
2007-02-19 21:05:59 +00:00