1
0
mirror of https://github.com/apache/httpd.git synced 2025-08-04 05:42:12 +03:00

115 Commits

Author SHA1 Message Date
99afa83362 Add 'server' to scope_to_string's list of possible suspects, as to avoid an error when LogLevel is trace
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1377457 13f79535-47bb-0310-9956-ffa450edef68
2012-08-26 17:01:21 +00:00
4141f17715 Add the missing state release to the LuaMapHandler handler as well, so we won't end in a potential deadlock when acquiring states for in the server scope.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1374310 13f79535-47bb-0310-9956-ffa450edef68
2012-08-17 15:12:41 +00:00
b7f2990d7b Add a missing release of a Lua state (when server scope is used) when a hook returns DECLINED.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1374295 13f79535-47bb-0310-9956-ffa450edef68
2012-08-17 14:45:33 +00:00
71ca51c1a6 mod_lua: Allow scripts handled by the lua-script handler to set a return
code that will be sent to the client, such as 302, 500 etc. This will
allow scripts to be able to f.x. redirect a user to another page by
returning 302.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1374185 13f79535-47bb-0310-9956-ffa450edef68
2012-08-17 09:41:46 +00:00
7393da8892 There is only one global provider name space, therefore allow
LuaAuthzProvider only in global scope.

Remove unnecessary server config field.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1370466 13f79535-47bb-0310-9956-ffa450edef68
2012-08-07 19:38:09 +00:00
d7b20ffb70 mod_lua: Decline to serve a request if the script doesn't exist, instead of throwing an internal server error.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1370377 13f79535-47bb-0310-9956-ffa450edef68
2012-08-07 17:29:26 +00:00
2e5559bb81 fix "lua_vmprep.c:29:6: warning: no previous prototype for ‘ap_lua_init_mutex’ [-Wmissing-prototypes]"
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1369800 13f79535-47bb-0310-9956-ffa450edef68
2012-08-06 12:05:47 +00:00
25fa9a1809 Reverting r1369758
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1369763 13f79535-47bb-0310-9956-ffa450edef68
2012-08-06 09:52:50 +00:00
864e336ee3 use the ap_mutex functions to create the mutex instead of the apr_mutex ones.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1369758 13f79535-47bb-0310-9956-ffa450edef68
2012-08-06 09:26:10 +00:00
b598e862d3 Add a server scope for Lua states (in LuaScope), which creates a pool of states with manageable minimum and maximum size.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1369656 13f79535-47bb-0310-9956-ffa450edef68
2012-08-05 19:57:44 +00:00
87bcd2414a Revert r1367504:
mod_lua: The current way of getting the authz provider name doesn't
   seem to work. This approach should fix that.

This is not necessary and breaks with "Require not ..."



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1369617 13f79535-47bb-0310-9956-ffa450edef68
2012-08-05 16:51:09 +00:00
ea66bb37ca mod_lua.c:189:13: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1368109 13f79535-47bb-0310-9956-ffa450edef68
2012-08-01 16:41:04 +00:00
238af542a3 mod_lua:
Clean up style
use apr_pstrcat instead of apr_psprintf
fix a bug that was causing bad string interpolations.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1367875 13f79535-47bb-0310-9956-ffa450edef68
2012-08-01 07:28:22 +00:00
5e36abf35a mod_lua: Add the (missing) LuaMapHandler directive to the fold.
This should work as the existing documentation describes.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1367725 13f79535-47bb-0310-9956-ffa450edef68
2012-07-31 19:43:29 +00:00
ce1213a92d mod_lua: The current way of getting the authz provider name doesn't seem to work. This approach should fix that.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1367504 13f79535-47bb-0310-9956-ffa450edef68
2012-07-31 11:47:04 +00:00
664f924857 mod_lua: Remember to set cfg->codecache to AP_LUA_CACHE_UNSET when creating a config
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1367048 13f79535-47bb-0310-9956-ffa450edef68
2012-07-30 09:36:44 +00:00
c67acaa6fc mod_lua: Pass on the request_rec to ap_lua_get_lua_state, so we can use it for allocating memory for the cache info lookup.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1367040 13f79535-47bb-0310-9956-ffa450edef68
2012-07-30 09:06:41 +00:00
f9b07d1b34 Add LuaCodeCache directive for controlling in-memory caching.
This might need some tweaking on the hash key generation for the mtime lookups, ideas are welcome.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1366890 13f79535-47bb-0310-9956-ffa450edef68
2012-07-29 19:07:38 +00:00
8c960a8c15 Various code clean up
Submitted by: Christophe JAILLET <christophe jaillet wanadoo fr>
PR: 52893 


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1361801 13f79535-47bb-0310-9956-ffa450edef68
2012-07-15 21:14:00 +00:00
99d37b2e33 Add new directive LuaAuthzProvider to allow implementing an
authorization provider in lua


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1351020 13f79535-47bb-0310-9956-ffa450edef68
2012-06-16 22:51:19 +00:00
d7ed5d0ed6 factor common code into utility function
also improve logging a bit and adjust some log levels


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1351018 13f79535-47bb-0310-9956-ffa450edef68
2012-06-16 22:46:30 +00:00
cbb93c651b change various strings from char * to const char *
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1351017 13f79535-47bb-0310-9956-ffa450edef68
2012-06-16 22:45:33 +00:00
76f782e188 Various code cleanup to avoid compiler, cppcheck, or clang warnings:
modules/debugging/mod_firehose.c: Make some internal functions static
                                  (to do: logs_cleanup() is unused)

modules/filters/mod_charset_lite.c: Remove dead assignments

modules/filters/mod_include.c: likewise

modules/metadata/mod_usertrack.c: likewise

modules/proxy/mod_proxy_ftp.c: likewise

modules/ssl/ssl_engine_pphrase.c: likewise

modules/proxy/mod_proxy_balancer.c: likewise;
                                    Remove NULL check that can never happen

modules/proxy/proxy_util.c: Axe NULL-check that can never happen and if it
                            would, it would just mask another bug

os/unix/unixd.c: likewise

modules/http/http_filters.c: Remove sub-condition that is always true

modules/lua/mod_lua.c: Add default cases to switch statements

modules/generators/mod_autoindex.c: Unsigned value can never be < 0

server/util_expr_eval.c: Fix compiler warnings with VC and on OS2



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1220493 13f79535-47bb-0310-9956-ffa450edef68
2011-12-18 17:52:59 +00:00
b9dacea0ea remove some dead code
found by clang statical analyzer


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1220462 13f79535-47bb-0310-9956-ffa450edef68
2011-12-18 17:25:40 +00:00
92e366007c Add lots of unique tags to error log messages
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1209766 13f79535-47bb-0310-9956-ffa450edef68
2011-12-02 23:02:04 +00:00
b53e38b314 add per-dir config merging to mod_lua so LuaHook* in multiple per-dir sections
behaves as expected instead of discarding previous sections.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1201443 13f79535-47bb-0310-9956-ffa450edef68
2011-11-13 15:48:06 +00:00
24b66f8823 Use the right lua scope when used as a hook.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1201042 13f79535-47bb-0310-9956-ffa450edef68
2011-11-11 20:22:08 +00:00
727cca9fdb don't let thread-scope be selected in a server w/o threads
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1200977 13f79535-47bb-0310-9956-ffa450edef68
2011-11-11 17:30:18 +00:00
45b5bfb549 C99 and unused variable warnings
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1200975 13f79535-47bb-0310-9956-ffa450edef68
2011-11-11 17:27:06 +00:00
bed1f11a32 use a sub-pool for scope_once
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1200667 13f79535-47bb-0310-9956-ffa450edef68
2011-11-11 00:49:05 +00:00
bc7ecfdcf9 replace server scope with thread scope
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1200656 13f79535-47bb-0310-9956-ffa450edef68
2011-11-11 00:16:56 +00:00
49ac1fbeb2 remove lingering reslist references before killing server scope
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1200646 13f79535-47bb-0310-9956-ffa450edef68
2011-11-10 23:57:57 +00:00
1278d68ae7 remove ability to set min and max pool sizes for server scope in prep for removing server scope
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1200639 13f79535-47bb-0310-9956-ffa450edef68
2011-11-10 23:54:00 +00:00
db8040ed4f remove some debug logging which snuck in
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1200614 13f79535-47bb-0310-9956-ffa450edef68
2011-11-10 23:13:08 +00:00
48a5e0390d * modules/lua/mod_lua.c (ap_lua_ssl_is_https): New function.
(lua_post_config): Pick up ssl_is_https optional function.

* modules/lua/lua_request.c (req_ssl_is_https_field): New function.
  (ap_lua_load_request): Map is_https field to above.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1200580 13f79535-47bb-0310-9956-ffa450edef68
2011-11-10 21:45:27 +00:00
5eb6753e25 remove last traces of the code cache
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1200513 13f79535-47bb-0310-9956-ffa450edef68
2011-11-10 20:02:07 +00:00
1cedf45414 fix issue with incorrect munging of the lua package path -- LuaPackagePath directives were not working
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1200475 13f79535-47bb-0310-9956-ffa450edef68
2011-11-10 18:48:50 +00:00
2fb4d8c18f ap_check_cmd_context checks don't work on the block forms
of the lua directives.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1200204 13f79535-47bb-0310-9956-ffa450edef68
2011-11-10 07:30:55 +00:00
2af550c8c9 mod_lua: Expose SSL variables via r:ssl_var_lookup()
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1199056 13f79535-47bb-0310-9956-ffa450edef68
2011-11-08 01:53:15 +00:00
d63996c35d allow some lua hooks to be run in "early" or "late" mode
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1199031 13f79535-47bb-0310-9956-ffa450edef68
2011-11-08 00:36:03 +00:00
629d9075cb quick handlers and translate_name in lua can't be keyed off
Directory/Filename/htaccess



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1197853 13f79535-47bb-0310-9956-ffa450edef68
2011-11-05 01:08:05 +00:00
bb2c7989ea get the hello world of Handlers working again
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1197782 13f79535-47bb-0310-9956-ffa450edef68
2011-11-04 21:17:57 +00:00
562c9d7876 quick handler in an external file is already enabled, quick handler in block
form seems to work just as well.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1187748 13f79535-47bb-0310-9956-ffa450edef68
2011-10-22 18:50:45 +00:00
374a42b9a0 More style fixes, no func changes
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1174937 13f79535-47bb-0310-9956-ffa450edef68
2011-09-23 18:20:43 +00:00
1951a037bf More cleanup: Expand tabs and some more indentation fixes
No functional change


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1174929 13f79535-47bb-0310-9956-ffa450edef68
2011-09-23 18:08:42 +00:00
427c85bd23 Cleanup effort in prep for GA push:
Trim trailing whitespace... no func change



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1174751 13f79535-47bb-0310-9956-ffa450edef68
2011-09-23 13:39:32 +00:00
7b61bedb2f Change the ap_cfg_getline() and ap_cfg_getc() to return an error code.
Also:
- Make ap_cfg_getline() return APR_ENOSPC if a config line is too long.
- Add ap_pcfg_strerror() function to convert ap_cfg_getline's return value
  into a nice message.
- Adjust definition of ap_configfile_t accordingly.

Not bumping MMN because it has already been bumped today.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1086756 13f79535-47bb-0310-9956-ffa450edef68
2011-03-29 21:29:34 +00:00
2fed37e78a apply patch from zhiguo zhao <zhaozg@gmail.com> to significantly improve server scope handling
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1081611 13f79535-47bb-0310-9956-ffa450edef68
2011-03-14 23:43:23 +00:00
affc4cf328 save some memory by using cmd->temp_pool instead of cmd->pool in some places
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1002156 13f79535-47bb-0310-9956-ffa450edef68
2010-09-28 13:19:33 +00:00
7716d3c3e3 Drop ap_body_to_table due to missing constraints; a DoS waiting
for an exploit.

Some mod_lua fan aught to revisit this and provide a sensible
implementation.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@953203 13f79535-47bb-0310-9956-ffa450edef68
2010-06-10 03:02:07 +00:00