1
0
mirror of https://github.com/apache/httpd.git synced 2025-09-21 06:02:00 +03:00

72 Commits

Author SHA1 Message Date
Joe Orton
36f619966b mod_so: Add -D DUMP_MODULE_DATA to print module data in structured
format (TOML) including MMN information.

* modules/core/mod_so.c (print_mod_data): New function.
  (dump_loaded_modules): Use it if DUMP_MODULE_DATA is defined.

* docs/manual/programs/httpd.xml: Move -DDUMP_* docs to a new
  section, cover the above new option.

Github: closes #537


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1926737 13f79535-47bb-0310-9956-ffa450edef68
2025-06-26 09:21:25 +00:00
Joe Orton
ffeacdcc52 Fix typo in code comments; dependancies -> dependencies
Submitted by: John Bampton <jbampton gmail.com>
Github: closes #520


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1924446 13f79535-47bb-0310-9956-ffa450edef68
2025-03-18 09:54:15 +00:00
Joe Orton
43721ffcee * modules/core/mod_macro.c (process_content): Return error if there's
enough not space to store the macro. Replaced MAX_STRING_LEN by
  sizeof(line).

PR: 69258
Submitted by: Marc Stern <marc.stern approach-cyber.com>
Github: closes #479


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1920588 13f79535-47bb-0310-9956-ffa450edef68
2024-09-12 08:36:55 +00:00
Joe Orton
400d4e121f * modules/core/mod_so.c (load_module): Log the file/lineno for a
duplicated LoadModule since it's often a symptom of some deeper
  mis-configuration.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1919496 13f79535-47bb-0310-9956-ffa450edef68
2024-07-24 12:48:10 +00:00
Stefan Eissing
5e49290435 *) mod_macro: use our own strncmp function
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1912993 13f79535-47bb-0310-9956-ffa450edef68
2023-10-16 06:38:32 +00:00
Stefan Eissing
3b7cc4481c *) mod_watchdog: add assertions to cleanup code
*) core/mpm_preform: do not invoke the fancy new child_stopping/stopped
     hooks when invoked from a signal handler. This is a stopgap to some
     strange behaviour in need of some deeper insight.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1898418 13f79535-47bb-0310-9956-ffa450edef68
2022-02-25 13:18:51 +00:00
Stefan Eissing
27e5fe3770 *) mod_watchdog: do not call a watchdog instance for
AP_WATCHDOG_STATE_STOPPING outside its thread, as
     watchdog instances are not prepared to be invoked
     concurrently.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1898376 13f79535-47bb-0310-9956-ffa450edef68
2022-02-24 13:20:19 +00:00
Stefan Eissing
338daf4719 *) mod_watchdog: use the child_stopping and child_stopped hooks
to shutdown workers before pool destruction releases global
     resources and libraries.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1898370 13f79535-47bb-0310-9956-ffa450edef68
2022-02-24 11:56:01 +00:00
Stefan Eissing
6c7a308b20 *) mod_watchdog: replace the new volatile with atomic access.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1898343 13f79535-47bb-0310-9956-ffa450edef68
2022-02-23 09:55:34 +00:00
Stefan Eissing
112acd9e2a *) mod_watchdog: use hook 'child_stopping' to signal watchdogs
that they should end processing.
     


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1898318 13f79535-47bb-0310-9956-ffa450edef68
2022-02-22 12:19:59 +00:00
Yann Ylavic
6044859057 core: Efficient ap_thread_current() when apr_thread_local() is missing.
#define ap_thread_create, ap_thread_current_create and ap_thread_current to
their apr-1.8+ equivalent if available, or implement them using the compiler's
thread_local mechanism if available, or finally provide stubs otherwise.

#define AP_HAS_THREAD_LOCAL to 1 in the two former case or 0 otherwise, while
AP_THREAD_LOCAL is defined to the compiler's keyword iff AP_HAS_THREAD_LOCAL.

Replace all apr_thread_create() calls with ap_thread_create() so that httpd
threads can use ap_thread_current()'s pool data as Thread Local Storage.

Bump MMN minor.

* include/httpd.h():
  Define AP_HAS_THREAD_LOCAL, AP_THREAD_LOCAL (eventually), ap_thread_create(),
  ap_thread_current_create() and ap_thread_current().
  
* server/util.c:
  Implement ap_thread_create(), ap_thread_current_create() and
  ap_thread_current() when APR < 1.8.

* modules/core/mod_watchdog.c, modules/http2/h2_workers.c,
    modules/ssl/mod_ssl_ct.c:
  Use ap_thread_create() instead of apr_thread_create.

* server/main.c:
  Use AP_HAS_THREAD_LOCAL and ap_thread_current_create instead of APR's.

* server/util_pcre.c:
  Use AP_HAS_THREAD_LOCAL and ap_thread_current instead of APR's.

* server/mpm/event/event.c, server/mpm/worker/worker.c,
    server/mpm/prefork/prefork.c:
  Use ap_thread_create() instead of apr_thread_create.
  Create an apr_thread_t/ap_thread_current() for the main chaild thread usable
  at child_init().
  
* server/mpm/winnt/child.c:
  Use ap_thread_create() instead of CreateThread().
  Create an apr_thread_t/ap_thread_current() for the main chaild thread usable



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897460 13f79535-47bb-0310-9956-ffa450edef68
2022-01-25 17:34:57 +00:00
Eric Covener
7fafffc8aa don't try to load modules from a NULL path
ap_server_root_relative() can fail if apr_filepath_merge fails,
which can happen with a "bad" drive/volume or who knows what 
else on Windows. Regardless, if !fullname we are already
going to retry wih what was actually passed.




git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1880461 13f79535-47bb-0310-9956-ffa450edef68
2020-07-31 01:21:25 +00:00
Yann Ylavic
8f5905c058 mod_watchdog: use a single "wd_running" pool in wd_worker() thread.
Clear the pool where appropriate instead of multiple create/destroy.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1876675 13f79535-47bb-0310-9956-ffa450edef68
2020-04-17 17:15:51 +00:00
Joe Orton
9e6be73065 * modules/core/mod_watchdog.c (wd_worker): Fix crashes snuck into
r1876599 where a destroyed pool was reused.  Rename the "ctx"
  variable to reflect its purpose.  Also tweak the pool tags.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1876619 13f79535-47bb-0310-9956-ffa450edef68
2020-04-16 17:55:48 +00:00
Yann Ylavic
f461bcf12c Add missing pool tags to help debugging.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1876599 13f79535-47bb-0310-9956-ffa450edef68
2020-04-16 12:32:33 +00:00
Joe Orton
452ae9a3c2 * modules/core/mod_watchdog.c: Switch to simpler logic to avoid the
thread cleanup running before the thread has started, avoiding
  mutex operations which both have undefined behaviour:

  a) double-locking an UNNESTED (non-recursive) mutex twice in the parent
  b) unlocking a mutex in the spawned thread which was locked by the parent

  (wd_startup, wd_worker_cleanup, wd_worker): Use a boolean to ensure
  the cleanup does nothing if the thread wasn't started, drop the mutex.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1876511 13f79535-47bb-0310-9956-ffa450edef68
2020-04-14 12:37:17 +00:00
Mike Rumph
85760859ca Fix spelling errors found by codespell. [skip ci]
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1873985 13f79535-47bb-0310-9956-ffa450edef68
2020-02-13 18:15:57 +00:00
Rainer Jung
304fb8e689 mod_watchdog: Correct some log messages and fix
compiler warning
"'rv' may be used uninitialized in this function".

Follow up to r1722154.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1815004 13f79535-47bb-0310-9956-ffa450edef68
2017-11-12 11:44:37 +00:00
Yann Ylavic
aa06756e7d mod_macro: fix usability of globally defined macros in .htaccess files.
PR 57525.

Reverts pre_config hook from r1656669 (happens too late for EXEC_ON_READ), and
ensures ap_macros is reset on restart with a pconf cleanup.

Proposed by: Jose Kahan <jose w3.org>
Reviewed by: ylavic


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1813643 13f79535-47bb-0310-9956-ffa450edef68
2017-10-28 16:05:51 +00:00
Jim Jagielski
09dc3b73d8 Allow WatchdogInterval to be sub 1 second
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1799435 13f79535-47bb-0310-9956-ffa450edef68
2017-06-21 12:49:54 +00:00
Jim Jagielski
f3a8efb9d0 Not an error... last one is honored
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1799431 13f79535-47bb-0310-9956-ffa450edef68
2017-06-21 12:34:25 +00:00
Jim Jagielski
18e99a8f19 name changes re: suggestion
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1778331 13f79535-47bb-0310-9956-ffa450edef68
2017-01-11 18:05:13 +00:00
Jim Jagielski
4e8baf18d2 Use pconf as parent pool so mutexes get cleaned on restarts/reloads
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1778319 13f79535-47bb-0310-9956-ffa450edef68
2017-01-11 16:00:37 +00:00
Jim Jagielski
eef5ab3b15 And another logno
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1770845 13f79535-47bb-0310-9956-ffa450edef68
2016-11-22 14:31:40 +00:00
Jim Jagielski
713b2c6f50 Oops. update logno
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1770844 13f79535-47bb-0310-9956-ffa450edef68
2016-11-22 14:29:36 +00:00
Jim Jagielski
fcca6d595d mod_macro improvements to bypass "expected" warnings and conflicts
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1770843 13f79535-47bb-0310-9956-ffa450edef68
2016-11-22 14:06:28 +00:00
Rainer Jung
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
William A. Rowe Jr
f76276273f Add watchdog by default at level 'most' for mod_proxy_hcheck
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1749924 13f79535-47bb-0310-9956-ffa450edef68
2016-06-23 15:34:46 +00:00
Rainer Jung
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
Christophe Jaillet
494d8d8d9a Fix sparse warnings introduced in r1722154 (inconsistent indenting)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1722701 13f79535-47bb-0310-9956-ffa450edef68
2016-01-03 07:11:58 +00:00
Jim Jagielski
cdb2aea61f Update w/ better logging
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1722154 13f79535-47bb-0310-9956-ffa450edef68
2015-12-29 15:38:29 +00:00
André Malo
baa5da2989 do some property cleanup
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1691908 13f79535-47bb-0310-9956-ffa450edef68
2015-07-20 10:13:38 +00:00
Yann Ylavic
e454f1a48b mod_macro: Clear macros before initialization to avoid use-after-free
on startup or restart when the module is linked statically. PR 57525

Submitted by: apache.org tech.futurequest.net
Committed by: Yann Ylavic


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1656669 13f79535-47bb-0310-9956-ffa450edef68
2015-02-03 10:42:21 +00:00
Christophe Jaillet
6ba037ed5c Remove APLOG_NOERRNO.
Add some APLOGNO.
Fix some alignment.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1612466 13f79535-47bb-0310-9956-ffa450edef68
2014-07-22 05:17:10 +00:00
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
Christophe Jaillet
04737f0afa Rename module name in doxygen + partly revert r832442 which skipped doxygen doc generation for 'mod_watchdog.h'
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1597642 13f79535-47bb-0310-9956-ffa450edef68
2014-05-26 20:25:01 +00:00
Jeff Trawick
f63c145039 fix spelling error in comment
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1571368 13f79535-47bb-0310-9956-ffa450edef68
2014-02-24 17:50:16 +00:00
Christophe Jaillet
fef0c66526 Allocate correct size for the array to avoid useless memory allocation and copy
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1555259 13f79535-47bb-0310-9956-ffa450edef68
2014-01-03 21:42:40 +00:00
André Malo
fdb6d62d78 eol-style = native
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1484554 13f79535-47bb-0310-9956-ffa450edef68
2013-05-20 18:22:55 +00:00
Gregg Lewis Smith
8e0c2d91e0 Add mod_macro to Windows build.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1436058 13f79535-47bb-0310-9956-ffa450edef68
2013-01-21 01:20:33 +00:00
Guenter Knauf
2028b7c09d Added mod_macro to NetWare build.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1435834 13f79535-47bb-0310-9956-ffa450edef68
2013-01-20 13:04:40 +00:00
Fabien Coelho
cecc389cfd Add "mod_macro" as a standard module, compiled in with "most".
This module was created in 1998 and has been distributed independently
ever since. It is hereby donated to the Apache Software Foundation.

There are quite a few comments in the source code to explain how it works,
as well as extensive non regression tests.

Some utilities about array processing could be moved to "core.c".
However, I finally decided against for now so that it stays as an external
and independent module, and thus may be backported with minimal impact
on the source tree.

Details of the addition:

* modules/core/mod_macro.c: module source code
* modules/core/test: non regression tests
  modules/core/test/conf/: configuration files
  modules/core/test/ref/: expected results
* docs/manual/mod/mod_macro.xml: English documentation
* docs/manual/mod/mod_macro.xml.fr: French documentation



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1435811 13f79535-47bb-0310-9956-ffa450edef68
2013-01-20 10:07:44 +00:00
Stefan Fritsch
5d010bf77c If a filename without slashes is specified for LoadFile or
LoadModule and the file cannot be found in the server root directory,
try to use the standard dlopen() search path. 


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1332378 13f79535-47bb-0310-9956-ffa450edef68
2012-04-30 20:50:45 +00:00
Mladen Turk
8238529b71 No need for process.h system include since we don't use getpid() any more
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1210447 13f79535-47bb-0310-9956-ffa450edef68
2011-12-05 13:09:54 +00:00
Mladen Turk
f63c6e73bc Axe check for second post config call. New ap_state_query(AP_SQ_MAIN_STATE) == AP_SQ_MS_CREATE_PRE_CONFIG API call does exactly that, so we were actually expecting 4 calls ending up with NULL config in child hook
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1210445 13f79535-47bb-0310-9956-ffa450edef68
2011-12-05 13:07:47 +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
Stefan Fritsch
4554d337cc Remove some getpid() logging, this is now also included in the error log
format.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1208835 13f79535-47bb-0310-9956-ffa450edef68
2011-11-30 22:15:55 +00:00
Jeff Trawick
20c036f9f5 s/WATCHODG/WATCHDOG/
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1203331 13f79535-47bb-0310-9956-ffa450edef68
2011-11-17 19:07:08 +00:00
Jim Jagielski
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
Jim Jagielski
103f776c25 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@1174748 13f79535-47bb-0310-9956-ffa450edef68
2011-09-23 13:38:09 +00:00