1
0
mirror of https://github.com/apache/httpd.git synced 2025-11-14 01:22:37 +03:00
Commit Graph

94 Commits

Author SHA1 Message Date
Christophe Jaillet
56d0c25725 Add missing APLOGNO.
Refactor some lines to keep APLOGNO on the same line as ap_log_error, when applicable.
Split lines longer than 80.
Improve alignment.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1612068 13f79535-47bb-0310-9956-ffa450edef68
2014-07-20 09:32:58 +00:00
Ben Reser
ccb1c5181a mod_lua: Remove dead code left over from the old code cache.
The code that used this was commented out in r721594, then removed entirely in
r728497, and finally a commit was made intending to remove the last traces of
the code cache in r1200513, but this initialization lived on anyway.

* modules/lua/mod_lua.c
  (create_server_config): Remove unused empty hash and rwlock for hash.

* modules/lua/mod_lua.h
  (ap_lua_server_cfg): Remove unneeded hash and rwlock entries.

Found by: Bert Huijben <rhuijben{_at_}collab.net>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1606836 13f79535-47bb-0310-9956-ffa450edef68
2014-06-30 16:54:27 +00:00
Jeff Trawick
303f962ea6 Follow up to r1604336: Comment out hooks whose only references are
now commented out, fixing a "-Wunused-function" warning


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1604631 13f79535-47bb-0310-9956-ffa450edef68
2014-06-22 18:14:31 +00:00
Daniel Gruno
0ac4c9dc26 Revert early|late argument for LuaHookCheckUserID as it does not work right now.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1604336 13f79535-47bb-0310-9956-ffa450edef68
2014-06-21 10:36:56 +00:00
Daniel Gruno
8ad00113ae mod_lua: Reformat and escape script error output.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1582247 13f79535-47bb-0310-9956-ffa450edef68
2014-03-27 10:44:43 +00:00
Daniel Gruno
31ad0e2d6b mod_lua: be a bit more verbose in error logging.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1578825 13f79535-47bb-0310-9956-ffa450edef68
2014-03-18 11:26:04 +00:00
Daniel Gruno
82e4ee75b0 mod_lua: Add a fixups hook that checks if the original request is intended for LuaMapHandler. This fixes a bug where FallbackResource invalidates the LuaMapHandler directive in certain cases by changing the URI before the map handler code executes.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1576981 13f79535-47bb-0310-9956-ffa450edef68
2014-03-12 22:56:44 +00:00
Christophe Jaillet
3f96d9992f 'ap_getword_conf' can not return NULL
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1551010 13f79535-47bb-0310-9956-ffa450edef68
2013-12-15 10:26:12 +00:00
Eric Covener
a8ad7b0e63 r1526906 followup:
error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1527063 13f79535-47bb-0310-9956-ffa450edef68
2013-09-27 20:30:47 +00:00
Daniel Gruno
5a2ba0a377 mod_lua: Use a (new) global pool/mutex setup for IVM rather than a per-process pool.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1526906 13f79535-47bb-0310-9956-ffa450edef68
2013-09-27 13:56:53 +00:00
Eric Covener
227ffd6486 mod_lua: If the first yield() of a LuaOutputFilter returns a string, it should
be prefixed to the response as documented.

Also, don't put empty heap buckets in the brigade if a yield() is called with 
no string.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1519492 13f79535-47bb-0310-9956-ffa450edef68
2013-09-02 18:38:07 +00:00
Eric Covener
8582560883 mod_lua: Remove ETAG, Content-Length, and Content-MD5 when a LuaOutputFilter
is configured without mod_filter. [Eric Covener]



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1519483 13f79535-47bb-0310-9956-ffa450edef68
2013-09-02 17:45:40 +00:00
Eric Covener
bc12f5ca71 register LuaOutputFilters with AP_FILTER_PROTO_CHANGE|AP_FILTER_PROTO_CHANGE_LENGTH
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1519476 13f79535-47bb-0310-9956-ffa450edef68
2013-09-02 17:06:16 +00:00
Eric Covener
d7aa057282 Return a 500 error instead of DECLINED when LuaHook* script does not
return a numeric value.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1519398 13f79535-47bb-0310-9956-ffa450edef68
2013-09-02 11:43:53 +00:00
Eric Covener
20996af3ee trace4 logging of return codes from LuaHook* functions.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1519329 13f79535-47bb-0310-9956-ffa450edef68
2013-09-02 01:21:39 +00:00
Daniel Gruno
1ad63fbb73 Adding a simple logging hook for mod_lua, which allows users to create their own logs or bypass the generic logging on a per-request basis.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1519277 13f79535-47bb-0310-9956-ffa450edef68
2013-09-01 15:10:32 +00:00
Eric Covener
a43dd91645 tolerate LuaMapHandler scripts that don't return anything
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1490098 13f79535-47bb-0310-9956-ffa450edef68
2013-06-06 01:04:17 +00:00
Guenter Knauf
586e050124 Remove unneeded exports from mod_lua - part 2.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1488114 13f79535-47bb-0310-9956-ffa450edef68
2013-05-31 07:03:15 +00:00
Daniel Gruno
98ebff29d7 Use a mutex to control read/write for IVM values, so we can reuse the existing structures without running into race conditions.
This should get rid of the need to have MaxConnectionsPerChild set to > 0.

If a new value is set and is a string, we either use the existing varbuf or grow it accordingly.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1470156 13f79535-47bb-0310-9956-ffa450edef68
2013-04-20 12:26:05 +00:00
Daniel Gruno
49fcd96e73 Using the traditional way of declaring Lua functions does not seem to work with NetWare (and possibly Windows too?)
Thus, at least until we find a smarter way, we have to move the r:* functions into lua_request.c and connect them from there.
The only functional change is that the transferred functions are now called through the request object instead of the apache2 package.
The distinction between what merited it to be in either structure seems very vague, so for now, we'll keep the HTTP return codes in the apache2 table, and the request/server functions in the request object.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1433967 13f79535-47bb-0310-9956-ffa450edef68
2013-01-16 14:52:52 +00:00
Daniel Gruno
5a3e2e44dc mod_lua: If a regex fails, return false plus an error message as second return value. Also fix some functions who weren't always returning a value.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1422373 13f79535-47bb-0310-9956-ffa450edef68
2012-12-15 22:03:47 +00:00
Daniel Gruno
3b6cdb0f92 mod_lua: Add a lot of core httpd/apr functionality to mod_lua
(such as regex matching, expr evaluation, changing/fetching server configuration/info - see docs for a complete list).
This also includes a bunch of automatically scraped functions, which may or may not be super useful.
Comments appreciated as always, especially on the more hacky bits.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1420377 13f79535-47bb-0310-9956-ffa450edef68
2012-12-11 20:08:24 +00:00
Stefan Fritsch
5eddb6d978 more coding style (no logic change)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1383028 13f79535-47bb-0310-9956-ffa450edef68
2012-09-10 18:37:23 +00:00
Stefan Fritsch
77e7551062 Fix warnings about unused variable and (false positive) "'mkey' may be used uninitialized in this function"
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1383022 13f79535-47bb-0310-9956-ffa450edef68
2012-09-10 18:25:17 +00:00
Stefan Fritsch
533878b7c7 Replace duplicate log msg numbers
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1383013 13f79535-47bb-0310-9956-ffa450edef68
2012-09-10 18:06:48 +00:00
Daniel Gruno
5ee40b970d Trying to tie up some loose ends:
- Return immediately if the return val of ap_pass_brigade != APR_SUCCESS
- Return a bit earlier when dealing with input filters, so as to not build up a huge backlog.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1377685 13f79535-47bb-0310-9956-ffa450edef68
2012-08-27 13:57:43 +00:00
Daniel Gruno
b947d24d85 Fix some style issues, use a more persistent bucket for passing along data (and clean it up the right places), and remove in/out-put filters from the chain if need be.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1377647 13f79535-47bb-0310-9956-ffa450edef68
2012-08-27 11:58:34 +00:00
Daniel Gruno
fd1fbe7908 Removing a misleading comment.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1377601 13f79535-47bb-0310-9956-ffa450edef68
2012-08-27 08:46:29 +00:00
Daniel Gruno
58e7c2a350 Add new directives, LuaInputFilter/LuaOutputFilter for creating content filters using Lua.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1377475 13f79535-47bb-0310-9956-ffa450edef68
2012-08-26 18:39:58 +00:00
Daniel Gruno
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
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
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
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
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
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
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
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
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