1
0
mirror of https://github.com/apache/httpd.git synced 2026-01-13 21:42:17 +03:00
Commit Graph

586 Commits

Author SHA1 Message Date
Yann Ylavic
d2bec9df64 core: ensure that MPMs return an error on runtime failure and hence that
httpd's main process also exits with an error.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1629925 13f79535-47bb-0310-9956-ffa450edef68
2014-10-07 16:54:31 +00:00
William A. Rowe Jr
3d737aca1f As noted by Yann, this resulted in a dead var assignment. Preinit won't
work due to the fact that we overload rv as both the DWORD windows result
and the apr_status_t result code.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1611244 13f79535-47bb-0310-9956-ffa450edef68
2014-07-17 04:30:25 +00:00
William A. Rowe Jr
dd79305a3b mpm_winnt: Accept utf-8 (Unicode) service names and descriptions for
internationalization.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1611169 13f79535-47bb-0310-9956-ffa450edef68
2014-07-16 20:15:49 +00:00
William A. Rowe Jr
ec69073576 General whitespace cleanup, error message normalization, and style conformance
for 80 character folding and legibility.

Folds several identical errors into the same APLOGNO() groups.

Catches several errors which were missing APLOGNO() entries, in the
existing groups and in one new message.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1611165 13f79535-47bb-0310-9956-ffa450edef68
2014-07-16 20:06:54 +00:00
Jeff Trawick
42bcf81be8 SECURITY (CVE-2014-3523): Fix a memory consumption denial of
service in the WinNT MPM used in all Windows installations.
Workaround: AcceptFilter <protocol> {none|connect}

Submitted by: trawick
Reviewed by: jorton, covener, jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1610652 13f79535-47bb-0310-9956-ffa450edef68
2014-07-15 11:15:26 +00:00
Jeff Trawick
39a3cbbaa8 clarify a comment
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1608785 13f79535-47bb-0310-9956-ffa450edef68
2014-07-08 13:54:09 +00:00
Jeff Trawick
0ff069dd31 Follow-up to r1606368: HANDLE is PVOID which is void * (fix format string)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1607352 13f79535-47bb-0310-9956-ffa450edef68
2014-07-02 12:51:20 +00:00
Jeff Trawick
71916e1357 Follow up to r1527220/r1588852:
Implement better error checking/reporting around notification of abrupt parent
process termination.

It is likely that something bad is happening here based on these
user reports:

https://www.apachelounge.com/viewtopic.php?p=27848
http://mail-archives.apache.org/mod_mbox/httpd-users/201406.mbox/%3CCAC%2BRZnuwLD%2BJnoy2TYO8oeAWt6bFLMa%3DEhfDf9hS3cuuGUHXAw%40mail.gmail.com%3E



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1606368 13f79535-47bb-0310-9956-ffa450edef68
2014-06-28 15:01:11 +00:00
Jim Jagielski
cdf5c0570f Now allow MPMs to call ap_log_common()
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1599603 13f79535-47bb-0310-9956-ffa450edef68
2014-06-03 15:25:59 +00:00
Christophe Jaillet
053a9e569a Better self document code
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1588852 13f79535-47bb-0310-9956-ffa450edef68
2014-04-21 06:51:36 +00:00
Jeff Trawick
30f8aa6460 more apr_file_write_full() simplification (like r1542413)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1542416 13f79535-47bb-0310-9956-ffa450edef68
2013-11-15 22:03:16 +00:00
Jeff Trawick
df246e149e Follow up to r1526666:
Use SYNCHRONIZE instead of PROCESS_ALL_ACCESS because

a. it is sufficient
b. it avoids an issue where PROCESS_ALL_ACCESS is larger on
   newer SDKs, resulting in a run-time error when running on
   older Windows

Close the handle.

Submitted by: Ivan Zhakov <ivan visualsvn.com>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1527220 13f79535-47bb-0310-9956-ffa450edef68
2013-09-28 19:14:25 +00:00
Jeff Trawick
90289779b6 WinNT MPM: Exit the child if the parent process crashes or is terminated.
Submitted by: Oracle, via trawick

The original modification was made some years ago for Oracle HTTP Server
by an Oracle employee.  trawick made additional changes for style and
for trunk/2.4.x changes.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1526666 13f79535-47bb-0310-9956-ffa450edef68
2013-09-26 20:08:33 +00:00
Eric Covener
a9297bf0b8 In 2.4, the MPM leaves a copy of the non-disconnected FD sitting in
context->accept_socket. This FD will be closed a second time, often
shortly after a worker picks it up in this same FD being reused.  The
first recv fails with WSAENOTSOCK since the same FD was closed in the
listener thread while the worker was pulling it off the queue

(The second close is of the underlying FD/socket, not a shared
apr_socket_t, so it's not short-circuited)

This patch makes it a bit more 2.2.x-ish and solves my problem -- the
context->accept_socket gets zapped at the bottom of the loop if
!disconnected.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1523387 13f79535-47bb-0310-9956-ffa450edef68
2013-09-15 02:25:32 +00:00
Eric Covener
5fb59d21c2 style consistency in winnt's worker_main
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1520760 13f79535-47bb-0310-9956-ffa450edef68
2013-09-07 12:44:09 +00:00
Jeff Trawick
dedba685f4 Mistakenly try to use a line comment to the end of your Listen
directive on Windows => crash-o-matic

Or,

WinNT MPM: Don't crash during child process initialization if the
Listen protocol is unrecognized. 


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1520368 13f79535-47bb-0310-9956-ffa450edef68
2013-09-05 16:33:11 +00:00
Christophe Jaillet
6fa9d10959 cppCheck: same expression on both side of '|'.
Fix it the same way other messages are managed in the function.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1419726 13f79535-47bb-0310-9956-ffa450edef68
2012-12-10 20:23:50 +00:00
Stefan Fritsch
67fde08ec7 Fix usage of MOD_* variables for MPM modules
r1385216 broke building of mpm event with serf support. To fix,

* introduce APACHE_MPMPATH_INIT/FINISH similar to
  APACHE_MODPATH_INIT/FINISH to create modules.mk and add
  MOD_* vars to it.
* change APACHE_MPM_MODULE to only append to modules.mk, not
  overwrite
* add APACHE_MPMPATH_INIT/FINISH to all MPMs


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1395252 13f79535-47bb-0310-9956-ffa450edef68
2012-10-07 08:56:45 +00:00
Jeff Trawick
d22e888e53 WinNT MPM logging:
clarify when it is the child process event handle being logged
log the child process id in a few obvious places


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1389316 13f79535-47bb-0310-9956-ffa450edef68
2012-09-24 11:58:52 +00:00
Jeff Trawick
f51c575d25 use state query API instead of static counters to determine processing
phase in check_config and post_config hooks


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1375013 13f79535-47bb-0310-9956-ffa450edef68
2012-08-20 13:31:24 +00:00
Jeff Trawick
fcaf040162 the rest of r1374877
minor cleanups
- don't duplicate prototype for child_main()
- make a few things static


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1374880 13f79535-47bb-0310-9956-ffa450edef68
2012-08-19 23:41:54 +00:00
Jeff Trawick
006ca1c1e0 minor cleanups
- don't duplicate prototype for child_main()
- make a few things static



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1374877 13f79535-47bb-0310-9956-ffa450edef68
2012-08-19 23:19:18 +00:00
Jeff Trawick
df758f654a correction to r1374780:
mpm_winnt.h now needs scoreboard.h for ap_generation_t


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1374876 13f79535-47bb-0310-9956-ffa450edef68
2012-08-19 23:16:50 +00:00
Jeff Trawick
c02f9309b6 WinNT MPM: Fix thread-safety issue in worker_main(). All
workers were allocating from pchild without holding '
child_lock.  Allocate from ptrans instead.

Related to: PR 52196

The reporter suggests that the apr_thread_t for r->connection->current_thread
should have a unique pool.  This revision handles that for WinNT MPM,
but not for other MPMs.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1374874 13f79535-47bb-0310-9956-ffa450edef68
2012-08-19 22:38:57 +00:00
Jeff Trawick
aa9b7b4cc5 WinNT MPM: Store pid and generation for each thread in scoreboard
to allow tracking of threads from exiting children via mod_status
or other such mechanisms.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1374780 13f79535-47bb-0310-9956-ffa450edef68
2012-08-19 16:00:57 +00:00
Jeff Trawick
fb6a888ee5 Windows: Fix output of -M, -L, and similar command-line options
which display information about the server configuration.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1374428 13f79535-47bb-0310-9956-ffa450edef68
2012-08-17 20:36:10 +00:00
Jeff Trawick
7f40cfd3ee initialize the protocol field when manufacturing an apr socket
lest accidential autodata contents leak into the apr_socket_t

(this doesn't address any known problem symptom)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1367819 13f79535-47bb-0310-9956-ffa450edef68
2012-07-31 23:19:56 +00:00
Jeff Trawick
f6a5811af6 Tweak a message added in r750567 so that the accept thread
logs the physical address it listens on instead of hostname|*.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1364138 13f79535-47bb-0310-9956-ffa450edef68
2012-07-21 18:17:10 +00:00
Jeff Trawick
aaa5d45e70 Follow the MS docs on AcceptEx/GetAcceptExSockaddrs by loading
the function pointers dynamically.

There's no indication that this will resolve any operational
glitches, but it might make the accept path slightly faster.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1363312 13f79535-47bb-0310-9956-ffa450edef68
2012-07-19 12:25:28 +00:00
Stefan Fritsch
1bbff8f19b Replace ap_create_core_ctx()/ap_core_ctx_get_bb() with a hook
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1240470 13f79535-47bb-0310-9956-ffa450edef68
2012-02-04 09:44:19 +00:00
Stefan Fritsch
e499c6e683 Make the core input/output filter contexts private and provide accessor APIs
for mpm_winnt and mod_ftp.

This allows to add members to the context structs without breaking binary
compatibility.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1235019 13f79535-47bb-0310-9956-ffa450edef68
2012-01-23 21:58:42 +00:00
Joe Orton
fd967eab44 * include/httpd.h, server/mpm/*/*.h: Tidy up doxygen tree view by moving
private interfaces into a separate group.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1211490 13f79535-47bb-0310-9956-ffa450edef68
2011-12-07 16:06:16 +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
William A. Rowe Jr
4d6a412856 Downgrade to DEBUG level several messages which were all redundant
to these NOTICE level messages;

Child: Starting %d worker threads
Child: All worker threads have exited


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1181216 13f79535-47bb-0310-9956-ffa450edef68
2011-10-10 20:22:18 +00:00
William A. Rowe Jr
e1d2cbab65 Resolve server and remote IP's in the AcceptFilter 'none' path.
Lower the volume on a number of debug messages (and omit errno
  where we have no errno).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1181140 13f79535-47bb-0310-9956-ffa450edef68
2011-10-10 19:02:09 +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
Jeff Trawick
c98f303210 Initialize apr_thread_t pointer to NULL so that apr_os_thread_put()
allocates a new one.  This resolves a crash seen on WinXP, caused
by r1103595.

Bad revision found by: Gregg L Smith <gls gknw.net>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1142264 13f79535-47bb-0310-9956-ffa450edef68
2011-07-02 18:53:29 +00:00
Stefan Fritsch
c9fd2623da Introduce ap_(get|set)_core_module_config() functions/macros and use them
everywhere.

We know that the core module has module_index 0. Therefore we can save
some pointer operations in ap_get_module_config(cv, &core_module) and
ap_set_module_config(cv, &core_module, val). As these are called rather often,
this may actually have some (small) measurable effect.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1132781 13f79535-47bb-0310-9956-ffa450edef68
2011-06-06 21:26:56 +00:00
William A. Rowe Jr
60b8058931 This is rather irritating.
We override exit() throughout the httpd build in order to intercept and
report our status through the service control manager.

We must include process.h prior to overriding exit().

I seem to remember that this is the reason apr.hw once included 
process.h unilaterally, to avoid this conflict over exit.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1129878 13f79535-47bb-0310-9956-ffa450edef68
2011-05-31 19:37:56 +00:00
Jeff Trawick
f60e484691 fill in conn_rec::current_thread for WinNT, NetWare, and OS/2 MPMs
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1103595 13f79535-47bb-0310-9956-ffa450edef68
2011-05-16 02:19:42 +00:00
Jeff Trawick
0598d43a1b fix some typos in comments
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1103593 13f79535-47bb-0310-9956-ffa450edef68
2011-05-16 02:01:08 +00:00
William A. Rowe Jr
737a5a1d47 Not possible; you don't declare a variable const and then
maniuplate it.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1100443 13f79535-47bb-0310-9956-ffa450edef68
2011-05-07 04:15:01 +00:00
Jeff Trawick
b615a1ca10 WinNT MPM has hard-coded daemon limit of 1, not 0
trunk mod_status relies on this value for proper formatting
of the workers; now we see '-' for the idle WinNT MPM workers
instead of ' '


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1096814 13f79535-47bb-0310-9956-ffa450edef68
2011-04-26 17:26:44 +00:00
Jeff Trawick
462c69e0b5 Add child_status hook for tracking creation/termination of MPM child
processes.  Add end_generation hook for notification when the last
MPM child of a generation exits.

end_generation is implemented completely by core using the
child_status hook run by the MPM.

simple and mpmt_os2 MPMs don't currently run the child_status
hook, so neither hook is invoked with those MPMs.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1096609 13f79535-47bb-0310-9956-ffa450edef68
2011-04-25 21:21:22 +00:00
Jeff Trawick
3f64cea357 AP_ENABLE_V4_MAPPED with WinNT MPM
mpm_winnt.c: Fail to compile if enabled, and add a hint about the
               issue to address before it will work.
  configure.in: Move the --enable-v4-mapped check to below the
                MPM logic, and default to --disable-v4-mapped if
                using the WinNT MPM


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1091467 13f79535-47bb-0310-9956-ffa450edef68
2011-04-12 15:26:25 +00:00
Jeff Trawick
51ad225698 add some debug logging to show more information about passing of sockets
between parent and child

the extra info is helpful when using a generic listener on an IPv6-
enabled box when either IPV6_V6ONLY isn't defined for the APR build
or httpd is built with IPv4-mapped addresses enabled 

in that case you'll see the parent writing one socket but the child
expecting too, before it bails out with

(OS 109)The pipe has been ended.  : Child: Unable to read socket data 
from parent


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1091421 13f79535-47bb-0310-9956-ffa450edef68
2011-04-12 14:15:27 +00:00
Jeff Trawick
4fd1d0eb42 axe the cast in the call to our mpm_nt_eventlog_stderr_open()
by fixing the function


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1091079 13f79535-47bb-0310-9956-ffa450edef68
2011-04-11 14:10:59 +00:00
Jeff Trawick
bd456ceef9 match expected type of arg to StartService()
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1091076 13f79535-47bb-0310-9956-ffa450edef68
2011-04-11 13:56:17 +00:00
Jeff Trawick
ebab39cd98 don't try to shut down child if it wasn't created
(or, fix warning about reference to uninitialized variable
child_exit_event)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1090634 13f79535-47bb-0310-9956-ffa450edef68
2011-04-09 17:20:23 +00:00