1
0
mirror of https://github.com/apache/httpd.git synced 2025-08-02 18:26:38 +03:00

115 Commits

Author SHA1 Message Date
826f90e639 mod_lua: Fix memory handling in output filters.
* modules/lua/mod_lua.c (lua_output_filter_handle): Fix brigade
  iteration to use constant memory.

Submitted by: G.Grandes <guillermo.grandes gmail.com>
PR: 69590
Github: closes #517


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1924095 13f79535-47bb-0310-9956-ffa450edef68
2025-02-28 08:24:10 +00:00
df126569e2 Remove unnecessary APLOGNO() use in TRACE-level logging.
Submitted by: Jackie Chang <jackie.qq.chang gmail.com>
PR: 55627


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1913338 13f79535-47bb-0310-9956-ffa450edef68
2023-10-26 07:31:16 +00:00
e61f23ee40 ap_lua_init_mutex() is not about thead only . It also calls
apr_global_mutex_child_init(). So I see no good reason to skip this hook
if !APR_HAS_THREADS.

Some #if APR_HAS_THREADS are also already in place in
ap_lua_init_mutex() anyway.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1898453 13f79535-47bb-0310-9956-ffa450edef68
2022-02-27 09:12:13 +00:00
8951949163 core/ap_ssl_*: changes after review by rpluem
- removed no longer needed (char*) casts when looking
   up ssl variables.
 - move 'goto cleanup;' on separate source line
 - fixed check for wrong optional function in ap_run_ssl_var_lookup
 - remove ap_bytes_t again from httpd.h and passes now ocsp
   identifier as separate const char* and apr_size_t. This
   follows more how such data is passed in the rest of the
   server.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1889009 13f79535-47bb-0310-9956-ffa450edef68
2021-04-20 12:16:05 +00:00
7c5e4c9ab2 Using the new ap_ssl_conn_is_ssl() and ap_ssl_var_lookup() in all internal modules.
* leaving mod_nw_ssl and mod_ssl itself untouched
 * removing mod_ssl.h includes where no longer necessary
 * some modules might skip post_config hooks, but those were left in, even when empty now.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1887364 13f79535-47bb-0310-9956-ffa450edef68
2021-03-09 12:55:55 +00:00
03b458e0e2 Add missing comma in some 'apr_apr_psprintf()' call if APR_HAS_THREADS is not defined
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1882060 13f79535-47bb-0310-9956-ffa450edef68
2020-09-27 09:00:35 +00:00
242d341756 Add missing "const" or "static const" qualifiers in some command_rec
definitions.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1882053 13f79535-47bb-0310-9956-ffa450edef68
2020-09-27 07:52:55 +00:00
4b34368df5 Restore broken win32 build, include apr/std headers before httpd headers
- In httpd we override exit() to trap the true exit code (see os/win32/os.h)
 - process.h was redefining exit() which picked up the macro instead of the
   original exit() declaration
 - Cleaner style pulls in apr, then standard C headers, and finally sets down
   the httpd includes on top of these, resolving the windows build regression




git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1881477 13f79535-47bb-0310-9956-ffa450edef68
2020-09-05 05:20:59 +00:00
53b5c234e9 Support building against Lua 5.4 by adjusting to the 3-arg form of
lua_resume().

* modules/lua/config.m4 (CHECK_LUA): Check for lua5.4 paths.

* modules/lua/mod_lua.c (lua_output_filter_handle,
  lua_input_filter_handle): Check that exactly one item is on the
  stack as indicated by lua_resume().

Submitted by: Lubos Uhliarik <luhliari redhat.com>, jorton
PR: 64591
Github: closes #130, closes #133, closes #134


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1880678 13f79535-47bb-0310-9956-ffa450edef68
2020-08-07 12:21:35 +00:00
3c47401358 Declare pre_translate hook in lua/info/log_debug/example modules, and docs.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1879077 13f79535-47bb-0310-9956-ffa450edef68
2020-06-22 10:34:28 +00:00
e3f96299c0 * modules/proxy/mod_proxy.c (create_proxy_config): Tag the pool.
* modules/lua/mod_lua.c (lua_post_config, create_vm_spec): Tag pools.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1862051 13f79535-47bb-0310-9956-ffa450edef68
2019-06-25 10:57:00 +00:00
d98ec3b059 More mod_lua compat for Lua 5.1, 5.2, 5.3.
One last use of luaL_register() with a non-NULL
"name" argument remaining.

Not tested yet.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1800815 13f79535-47bb-0310-9956-ffa450edef68
2017-07-04 20:35:06 +00:00
d1105fd4f2 mod_lua: Improve compatibility with Lua 5.1, 5.2 and 5.3.
PR58188, PR60831, PR61245.

Still to solve: replace uses of luaL_register().


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1800809 13f79535-47bb-0310-9956-ffa450edef68
2017-07-04 19:22:23 +00:00
e149a8d8d0 Fix some style issue.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1772490 13f79535-47bb-0310-9956-ffa450edef68
2016-12-03 21:59:55 +00:00
cd677cee0c The default value of 'inherit' should be AP_LUA_INHERIT_UNSET.
With this value, the behavior is the same as 'parent-first' in the 'LuaInherit' directive

If not explicitelly initialized, its value is 0 because of the 'apr_calloc 'in 'create_dir_config'. 0 means 'AP_LUA_INHERIT_NONE'

PR 60419

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1772489 13f79535-47bb-0310-9956-ffa450edef68
2016-12-03 21:37:52 +00:00
d79b514c4b Fix spelling in comments and text files.
No functional change.
PR 59990


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1756038 13f79535-47bb-0310-9956-ffa450edef68
2016-08-11 19:50:02 +00:00
bf5205907b * modules/lua/mod_lua.c (lua_post_config): Use anonymous shm segment
in preference to named segment.  Ensure startup is possible after an
  unclean shutdown.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1738229 13f79535-47bb-0310-9956-ffa450edef68
2016-04-08 11:02:14 +00:00
af14d158a3 Added many log numbers to log statements that
had none.

Those were not detected by the coccinelle script.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1725485 13f79535-47bb-0310-9956-ffa450edef68
2016-01-19 12:02:41 +00:00
44ce30494e Added many log numbers to log statements that
had none.

Handled all files in modules/.

I used the coccinelle script provided by Stefan.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1725392 13f79535-47bb-0310-9956-ffa450edef68
2016-01-19 00:03:18 +00:00
eca303e318 * mod_lua: fix compilation with lua-5.3
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1668827 13f79535-47bb-0310-9956-ffa450edef68
2015-03-24 09:13:12 +00:00
38535f55b1 *) SECURITY: CVE-2014-8109 (cve.mitre.org)
mod_lua: Fix handling of the Require line when a LuaAuthzProvider is
     used in multiple Require directives with different arguments.
     PR57204 [Edward Lu <Chaosed0 gmail.com>]

Submitted By: Edward Lu
Committed By: covener



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1642499 13f79535-47bb-0310-9956-ffa450edef68
2014-11-30 01:41:26 +00:00
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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