Daniel Gruno
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
Daniel Gruno
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
Daniel Gruno
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
Guenter Knauf
7814748ab3
NetWare build tweaks.
...
Make more use of internal makefile macros;
axed now obsolete include paths.
Submitted by: normw gknw net.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1371177 13f79535-47bb-0310-9956-ffa450edef68
2012-08-09 12:11:09 +00:00
Stefan Fritsch
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
Daniel Gruno
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
Daniel Gruno
2e9e74fd6c
mod_lua: Add r:flush, r:sendfile as well as additional request information in the request_rec structure
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1370158 13f79535-47bb-0310-9956-ffa450edef68
2012-08-07 10:02:27 +00:00
Jeff Trawick
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
Jeff Trawick
93111a7645
fix "lua_vmprep.c:355:17: warning: no previous prototype for ‘copy_vm_spec’ [-Wmissing-prototypes]"
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1369793 13f79535-47bb-0310-9956-ffa450edef68
2012-08-06 11:48:46 +00:00
Daniel Gruno
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
Daniel Gruno
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
Daniel Gruno
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
Stefan Fritsch
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
Jeff Trawick
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
Daniel Gruno
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
Daniel Gruno
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
Daniel Gruno
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
Daniel Gruno
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
Daniel Gruno
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
Daniel Gruno
c0cc85a065
mod_lua: Fix up LuaCodeCache:
...
- Check both mtime and size of a file when comparing with cache, in case the file is being written to while read
- If LuaCodeCache is 'never', only reload it if it has been run once or more.
- Never use cache if LuaScope is 'once'.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1367025 13f79535-47bb-0310-9956-ffa450edef68
2012-07-30 08:19:14 +00:00
Daniel Gruno
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
Daniel Gruno
759dfc8e96
LUA_COMPAT_ALL should be defined _before_ including lua headers
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1366621 13f79535-47bb-0310-9956-ffa450edef68
2012-07-28 09:09:07 +00:00
Stefan Fritsch
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
Rainer Jung
bfbbc819d5
Add missing HTTP status codes taken from
...
http://www.iana.org/assignments/http-status-codes/http-status-codes.xml
The new codes are now known and some canned error
strings are provided. The web server does not yet actually
produce them in responses or reacts on getting them
from an origin server when acting as a proxy or gateway.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1361784 13f79535-47bb-0310-9956-ffa450edef68
2012-07-15 20:22:03 +00:00
Daniel Gruno
f921f8cbde
- Define LUA_COMPAT_ALL so mod_lua will be compatible with Lua 5.2
...
- Add an optional integer argument for parsebody, specifying the maximum size of POST that will be accepted.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1361298 13f79535-47bb-0310-9956-ffa450edef68
2012-07-13 16:59:07 +00:00
Daniel Gruno
68bbfde6ea
Add the missing parsebody function to mod_lua, for parsing POST data.
...
PR 53064.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1352047 13f79535-47bb-0310-9956-ffa450edef68
2012-06-20 11:20:36 +00:00
Stefan Fritsch
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
Stefan Fritsch
2385ef2c2f
use macro to make definition of integer fields more compact
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1351019 13f79535-47bb-0310-9956-ffa450edef68
2012-06-16 22:47:48 +00:00
Stefan Fritsch
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
Stefan Fritsch
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
Stefan Fritsch
32f5f54c25
mod_lua: Add a few missing request_rec fields. Rename remote_ip to
...
client_ip to match conn_rec
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1351014 13f79535-47bb-0310-9956-ffa450edef68
2012-06-16 22:41:01 +00:00
Stefan Fritsch
eca6d64df0
allow tail call optimization in log methods, remove foo method
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1351013 13f79535-47bb-0310-9956-ffa450edef68
2012-06-16 22:39:54 +00:00
Stefan Fritsch
ca02d628a6
Change prototype of vm_construct, to work around gcc bug which
...
causes a segfault.
PR: 52779
Submitted by: Dick Snippe <Dick Snippe tech omroep nl>
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1351012 13f79535-47bb-0310-9956-ffa450edef68
2012-06-16 22:38:58 +00:00
André Malo
a11c89f232
fix various property issues
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1309567 13f79535-47bb-0310-9956-ffa450edef68
2012-04-04 19:49:25 +00:00
Stefan Fritsch
7b8c246611
Be more verbose when logging syntax errors
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1305586 13f79535-47bb-0310-9956-ffa450edef68
2012-03-26 20:59:11 +00:00
Stefan Fritsch
03a8b1b4c2
Fix some typos
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1300766 13f79535-47bb-0310-9956-ffa450edef68
2012-03-14 22:21:50 +00:00
Rainer Jung
7b167c68d3
Remove luaL_reg macro definition no longer needed
...
and simplify lua_load compatibility macro.
Note that in order to successfully compile with
Lua 5.2.0 we still need to add LUA_COMPAT_ALL
to CPPFLAGS. Detection in config.m4 is still
missing.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1239030 13f79535-47bb-0310-9956-ffa450edef68
2012-02-01 09:51:59 +00:00
Rainer Jung
d0257e2db8
luaL_reg was already deprecated in Lua 5.1.4.
...
It is gone in Lua 5.2.0 and was replaced by luaL_Reg
which already existed in 5.1.4. So use that one..
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1239029 13f79535-47bb-0310-9956-ffa450edef68
2012-02-01 09:50:14 +00:00
Guenter Knauf
3db3bf501c
Make mod_lua compile with lua 5.2.x.
...
MOdified patch submitted by NormW (nornw gknw net).
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1221205 13f79535-47bb-0310-9956-ffa450edef68
2011-12-20 11:27:43 +00:00
Stefan Fritsch
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
Stefan Fritsch
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
Graham Leggett
cb21a0dbcc
Further clarify the naming of the entity that directly connects to us by
...
calling that entity a client instead of a peer.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1214015 13f79535-47bb-0310-9956-ffa450edef68
2011-12-14 01:10:52 +00:00
Stefan Fritsch
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
Graham Leggett
394e5594d6
Introduce a per connection "peer_ip" and a per request "client_ip" to
...
distinguish between the raw IP address of the connection and the effective
IP address of the request.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1206291 13f79535-47bb-0310-9956-ffa450edef68
2011-11-25 19:42:04 +00:00
Jeff Trawick
582674a462
remove lingering reslist cruft
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1203632 13f79535-47bb-0310-9956-ffa450edef68
2011-11-18 12:59:36 +00:00
Eric Covener
f2a7fff9ae
add some todos from my apachecon notes
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1201460 13f79535-47bb-0310-9956-ffa450edef68
2011-11-13 17:10:03 +00:00
Eric Covener
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
Rainer Jung
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
Eric Covener
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
Eric Covener
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