Commit Graph

26 Commits

Author SHA1 Message Date
Stefan Bühler 5c68caa6d7 [core] replace array weakref with vector
From: Stefan Bühler <stbuehler@web.de>

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@3116 152afb58-edef-0310-8abb-c4023f1b3aa9
2016-03-19 15:27:38 +00: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 68e4a416cc [core] provide array_extract_element and use it
From: Stefan Bühler <stbuehler@web.de>

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@3102 152afb58-edef-0310-8abb-c4023f1b3aa9
2016-03-15 18:56:02 +00:00
Stefan Bühler 224bf545c1 [core] refactor array search; raise array size limit to SSIZE_MAX
- raise array size limit from INT_MAX to SSIZE_MAX. INT_MAX already
  is way to high to be hit in any sane scenario, but SSIZE_MAX can
  *obviously* not be hit due to memory constraints.
- use size_t for array indices instead of int
- use binary search instead of next_power_of_2 hack; document invariants
  and check them in debug mode (asserts).
- return the actual insert position instead of something near

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

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@3100 152afb58-edef-0310-8abb-c4023f1b3aa9
2016-03-15 18:41:57 +00:00
Stefan Bühler 8d8ae9cbc8 [core] improve array API to prevent theoretical memory leaks
- refactor insert into array_find_or_insert; if the element already
  exists the caller must resolve the conflict manually:
  - array_replace frees the old element
  - array_insert_unique calls "insert_dup"
  both have no return value anymore
- fix usages of array_replace; they now don't need to delete the old
  entry anymore; usage in configparser was probably broken, as it
  possibly deleted the old element before calling array_replace

This should fix a lot of the issues reported in "Fortify Open Review
Project - lighttpd 1.4.39" (usually hitting the array limit):
when the array size limit was hit "new" entries leaked instead of
getting added.

On 32-bit INT_MAX entries cannot actually be reached (each entry
requires at least 48 bytes, leading to a total of 96GB memory).

On 64-bit INT_MAX entries would require 224GB memory, so it would be
theoretically possible. But it would need 2^27 reallocations of two
C-arrays of up to 16GB size.

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

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@3098 152afb58-edef-0310-8abb-c4023f1b3aa9
2016-03-15 18:26:57 +00:00
Stefan Bühler ad65603ec0 [core] fix conditional cache handling
- add new "skip" result to mark conditions that didn't actually get
  evaluated to false but just skipped because the preconditions failed.
- add "local_result" for each cache entry to remember whether the
  condition itself matched (not including the preconditions).
  this can be reused after a cache reset if the condition itself was not
  reset, but the preconditions were
- clear result of subtree (children and else-branches) when clearing a
  condition cache

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

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@3082 152afb58-edef-0310-8abb-c4023f1b3aa9
2016-02-21 18:32:14 +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 4f4d40f3f7 Add "lighty.req_env" table to mod_magnet for setting/getting environment values for cgi (fixes #1967, thx presbrey)
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2515 152afb58-edef-0310-8abb-c4023f1b3aa9
2009-06-10 13:08:15 +00:00
Stefan Bühler 066b208bb6 Added Language conditional (fixes #1119); patch by petar
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2392 152afb58-edef-0310-8abb-c4023f1b3aa9
2009-02-05 22:36:58 +00:00
Xuefer 9ffe08a583 merged part of [1528] from trunk: added the new options and added alternative names for user-agent, remote-ip and query-string
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2112 152afb58-edef-0310-8abb-c4023f1b3aa9
2008-03-02 11:46:44 +00:00
Elan Ruusamäe d6b9709b54 - support for matching $HTTP["scheme"] in configs, patch from:
http://trac.lighttpd.net/trac/wiki/HowToRedirectHttpToHttps
  apparently by swiergot/at/gmail.com, adjusted for current svn.


git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2012 152afb58-edef-0310-8abb-c4023f1b3aa9
2007-11-04 16:53:17 +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
Marcus Rückert 8cd1471cb3 - white space cleanup part 2 this time 1.4 ;)
i hope it helps with merging stuff back to 1.5

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@1371 152afb58-edef-0310-8abb-c4023f1b3aa9
2006-10-04 13:26:23 +00:00
Jan Kneschke 3b73da83a2 merged [1217]
fixed allow-http-11


git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.11-ssl-fixes@1282 152afb58-edef-0310-8abb-c4023f1b3aa9
2006-09-07 11:05:41 +00:00
Jan Kneschke b4d9d061c8 either remove include config.h or covered it in HAVE_CONFIG_H
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@733 152afb58-edef-0310-8abb-c4023f1b3aa9
2005-09-24 12:06:04 +00:00
Xuefer f387d89870 fix merging of auto-indexing element, and make autoload modules hack to use array merging
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@616 152afb58-edef-0310-8abb-c4023f1b3aa9
2005-08-23 14:35:01 +00:00
Jan Kneschke c052589bb3 load mod_indexfile before, mod_fastcgi and friends and let array regenerated unique ids if necessary
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@560 152afb58-edef-0310-8abb-c4023f1b3aa9
2005-08-17 09:56:33 +00:00
Xuefer 6044dbc5b3 make output of array/config same format as lighttpd.conf, with auto indention
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@554 152afb58-edef-0310-8abb-c4023f1b3aa9
2005-08-17 06:47:07 +00:00
Jan Kneschke 75c3a8393a added include_shell option to configfiles (merged the rest of the trunk changesets)
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@530 152afb58-edef-0310-8abb-c4023f1b3aa9
2005-08-09 06:42:33 +00:00
Jan Kneschke 8b07d57d66 added weak-ref and nicer print() (merged [332], [336])
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@528 152afb58-edef-0310-8abb-c4023f1b3aa9
2005-08-08 17:25:06 +00:00
Jan Kneschke 630bf7c857 const 1st arg for copy/print (merged [314])
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@525 152afb58-edef-0310-8abb-c4023f1b3aa9
2005-08-08 16:36:51 +00:00
Jan Kneschke 6e78c2c8df user defined variable, compute on parsing: string+string, int+int, array+array, var+=expression.
"include" sub configuration file. (merged ([308], [309], [306], [305])


git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@520 152afb58-edef-0310-8abb-c4023f1b3aa9
2005-08-08 14:40:47 +00:00
Jan Kneschke 8073d5fe9f added nested conditionals (merged [298])
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@519 152afb58-edef-0310-8abb-c4023f1b3aa9
2005-08-08 13:48:33 +00:00
Jan Kneschke 9e75ba0096 indent array for readability (merged [288])
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@508 152afb58-edef-0310-8abb-c4023f1b3aa9
2005-08-08 10:16:53 +00:00
Jan Kneschke b5e848d5b4 - Added hash, round-robin balancers
- fixed return codes in two cases
- droped some endless loops
- FIXME: re-enabling of dead hosts is missing for now


git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.3.x@350 152afb58-edef-0310-8abb-c4023f1b3aa9
2005-05-08 06:25:17 +00:00
Jan Kneschke bcdc6a3bbc moved everything below trunk/ and added branches/ and tags/
git-svn-id: svn://svn.lighttpd.net/lighttpd/trunk@30 152afb58-edef-0310-8abb-c4023f1b3aa9
2005-02-20 14:27:00 +00:00