Rainer Jung
10423926d0
lua header update part 1: EDOESNOTBUILD.
...
First include mod_lua which sets LUA_COMPAT_ALL,
then lua.h which uses it.
Needed at least to build with lua 5.2.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1479718 13f79535-47bb-0310-9956-ffa450edef68
2013-05-06 23:23:43 +00:00
Guenter Knauf
804c2032a7
Fixed the base64 functions.
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1476785 13f79535-47bb-0310-9956-ffa450edef68
2013-04-28 14:59:46 +00:00
Guenter Knauf
8f652c1b74
Added function to get all entries of a directory.
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1476601 13f79535-47bb-0310-9956-ffa450edef68
2013-04-27 15:26:08 +00:00
Guenter Knauf
f231cd4e08
Reduce compiler warnings.
...
Fixed some types, added casts, or changed to proper function.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1476482 13f79535-47bb-0310-9956-ffa450edef68
2013-04-27 03:23:55 +00:00
Guenter Knauf
bda0a282fe
Fixed r.started value to return seconds.
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1470157 13f79535-47bb-0310-9956-ffa450edef68
2013-04-20 12:32:08 +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
35f9ad9165
use ap_varbuf instead of allocating new strings each time we override an old one.
...
This uses leaks less memory, but it's still not perfect (but it's a start - maybe I need to use a mutex for this, to override the original object without running into race conditions)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1470155 13f79535-47bb-0310-9956-ffa450edef68
2013-04-20 11:20:22 +00:00
Daniel Gruno
9f39d246e8
r.started already exists as a built in variable, so let's not make it a function as well.
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1470117 13f79535-47bb-0310-9956-ffa450edef68
2013-04-20 07:18:23 +00:00
Daniel Gruno
5d652f66ec
exists_config_define should return a boolean, not a number, or it will always evaluate to true.
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1469844 13f79535-47bb-0310-9956-ffa450edef68
2013-04-19 14:28:25 +00:00
Daniel Gruno
a433e37ec8
remove redundant code
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1469751 13f79535-47bb-0310-9956-ffa450edef68
2013-04-19 09:04:52 +00:00
Daniel Gruno
8049067196
Remove lua_ap_banner, as it's no longer being used.
...
Add ivm_get/ivm_set for Inter-VM data transfer. This allows multiple VMs across a process to share data without having to resort to external databases or filesystems. This is a work in progress, and I have yet to work out a proper way of resetting a variable without causing a memory leak (this could be done by allocating a new pool for each object, but I'm trying to see if there's a more efficient way). Comments, ideas etc are most welcome.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1469744 13f79535-47bb-0310-9956-ffa450edef68
2013-04-19 08:46:28 +00:00
Guenter Knauf
b8fc4783c7
Only ask for the stat info we really use.
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1467822 13f79535-47bb-0310-9956-ffa450edef68
2013-04-14 20:03:07 +00:00
Guenter Knauf
abc30cfcd9
Return early with an error instead of returning an incomplete match table.
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1467721 13f79535-47bb-0310-9956-ffa450edef68
2013-04-14 02:53:36 +00:00
Guenter Knauf
0e18686c12
Whoops, one AP_MAX_REG_MATCH not caught.
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1467719 13f79535-47bb-0310-9956-ffa450edef68
2013-04-14 02:50:19 +00:00
Guenter Knauf
97e8153a9c
Decouple mod_lua max regex matches from AP_MAX_REG_MATCH.
...
Bumped the default to 25 matches; this default can be
overwritten with a CLFAGS define.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1467718 13f79535-47bb-0310-9956-ffa450edef68
2013-04-14 02:36:23 +00:00
Daniel Gruno
e1ae43e3ab
silly me
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1467572 13f79535-47bb-0310-9956-ffa450edef68
2013-04-13 07:45:09 +00:00
Daniel Gruno
336d9f37ef
fix some bugs reported by fuankg on Windows release builds.
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1467571 13f79535-47bb-0310-9956-ffa450edef68
2013-04-13 07:40:42 +00:00
Daniel Gruno
06014240dc
fix up r.banner and r.port so they work like variables and not functions (seems to have already been put in there), duplicate??
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1467558 13f79535-47bb-0310-9956-ffa450edef68
2013-04-13 06:33:07 +00:00
Daniel Gruno
df8901ec7b
fix docs on regex matching, change the actual ordering of arguments to match the docs, and enforce AP_MAX_REG_MATCH in the function, should it somehow return more matches than we have allocated
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1467557 13f79535-47bb-0310-9956-ffa450edef68
2013-04-13 06:24:11 +00:00
Guenter Knauf
160cff8b27
MOdified r:stat() to return finer time granularity.
...
the atime, mtime, ctime, size values ar now in mod_lua
64bit as received from apr_stat().
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1467427 13f79535-47bb-0310-9956-ffa450edef68
2013-04-12 19:15:39 +00:00
Guenter Knauf
07142dbd92
Fixed typo; followup to r1467188.
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1467409 13f79535-47bb-0310-9956-ffa450edef68
2013-04-12 18:45:46 +00:00
Guenter Knauf
b610081619
Added optional parameter flags to lua_ap_regex().
...
This enables to call r:regex() with a flag to do
case-insensitive matches.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1467188 13f79535-47bb-0310-9956-ffa450edef68
2013-04-12 07:29:56 +00:00
Guenter Knauf
29b9f3f42c
Fixed Lua r:stat() time values.
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1466743 13f79535-47bb-0310-9956-ffa450edef68
2013-04-11 00:19:30 +00:00
Daniel Gruno
2aa8e5eb40
r:regex was not returning the last captured group, as we were one off on how many captures to push to the table.
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1445609 13f79535-47bb-0310-9956-ffa450edef68
2013-02-13 14:02:43 +00:00
Daniel Gruno
89d818870d
If r:regex does not match, only return 'false', don't try to create error messages, because there should not be any - it's either match or no match here at this point.
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1434065 13f79535-47bb-0310-9956-ffa450edef68
2013-01-16 18:00:04 +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
0e04ce5529
Add database features for mod_lua (apr_dbd + mod_dbd).
...
See documentation update for API and examples.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1430225 13f79535-47bb-0310-9956-ffa450edef68
2013-01-08 11:42:50 +00:00
Daniel Gruno
d9e3aa7316
Remove reference to top secret project! You did not see this commit message ;)
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1424938 13f79535-47bb-0310-9956-ffa450edef68
2012-12-21 14:49:06 +00:00
Daniel Gruno
8767ad9988
mod_lua: Fix multipart post parsing, so it doesn't include random bytes at the end.
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1424723 13f79535-47bb-0310-9956-ffa450edef68
2012-12-20 21:52:03 +00:00
Daniel Gruno
ff81e58f05
mod_lua: Fix Windows compatibility issues and remove an unused variable. Thanks, Gregg!
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1422072 13f79535-47bb-0310-9956-ffa450edef68
2012-12-14 20:44:41 +00:00
Daniel Gruno
df178d1e41
mod_lua: Fix signedness/other small bugs as per cjaillet/fuankg's emails - thanks guys :)
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1421780 13f79535-47bb-0310-9956-ffa450edef68
2012-12-14 10:15:37 +00:00
Daniel Gruno
1a50285096
lua_request.c: Add support for parsing multipart form data via r:parsebody. This is a bit RFC-centric, suggestions are most welcome.
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1420286 13f79535-47bb-0310-9956-ffa450edef68
2012-12-11 17:09:40 +00:00
Daniel Gruno
c36aeb051d
mod_lua/lua_request.c: Make r:write return the return value of ap_rwrite, so mod_lua can check for success/failure in writing.
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1420176 13f79535-47bb-0310-9956-ffa450edef68
2012-12-11 14:06:41 +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
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
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
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
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
Joe Orton
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
Eric Covener
e66f481ac3
expose r:trace1-8
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1200432 13f79535-47bb-0310-9956-ffa450edef68
2011-11-10 17:10:17 +00:00
Eric Covener
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
Eric Covener
eaffe604d0
correct return val, the char* is pushed on the lua stack.
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1199028 13f79535-47bb-0310-9956-ffa450edef68
2011-11-08 00:25:47 +00:00
Eric Covener
9143f29d2d
provide ap_escape_html as r:escape_html()
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1197838 13f79535-47bb-0310-9956-ffa450edef68
2011-11-05 00:16:36 +00:00
Eric Covener
214b8e88b0
make r.handler and r.proxyreq readable too
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1195172 13f79535-47bb-0310-9956-ffa450edef68
2011-10-30 14:39:20 +00:00
Eric Covener
1abbc00118
add constants for PROXYREQ_* to the apache2 global, allow r.proxyreq and
...
r.handler to be writable.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1195168 13f79535-47bb-0310-9956-ffa450edef68
2011-10-30 14:30:04 +00:00
Eric Covener
89b65554be
alphabetize writable lua properties and use strcmp() for the oddball that's
...
just testing quality of "user".
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1195167 13f79535-47bb-0310-9956-ffa450edef68
2011-10-30 14:19:45 +00:00