1
0
mirror of https://github.com/apache/httpd.git synced 2026-10-23 22:49:01 +03:00
Commit Graph

2856 Commits

Author SHA1 Message Date
Brian Pane
e0b3cdeeac Use the new APR_POLLSET_NOCOPY option when creating the core pollset.
This eliminates the descriptor copying and mutex operations, and
O(n)-time apr_pollset_remove() loop when used with an apr_pollset
implementation that support the no-copy optimization.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/async-dev@327757 13f79535-47bb-0310-9956-ffa450edef68
2005-10-23 06:46:00 +00:00
Brian Pane
37c6f924a2 more verbose error message on write completion error
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/async-dev@312539 13f79535-47bb-0310-9956-ffa450edef68
2005-10-10 04:23:14 +00:00
Brian Pane
04745bea8e Enabled async write completion in the Event MPM
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/async-dev@312536 13f79535-47bb-0310-9956-ffa450edef68
2005-10-10 03:49:31 +00:00
Brian Pane
8c5077d5c6 Added a missing return value in ap_core_output_filter
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/async-dev@312532 13f79535-47bb-0310-9956-ffa450edef68
2005-10-10 03:18:51 +00:00
Brian Pane
072aeca61f Fixed processing of pipelined requests
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/async-dev@312512 13f79535-47bb-0310-9956-ffa450edef68
2005-10-09 22:54:44 +00:00
Brian Pane
42bf8b16c9 Refactored CONN_STATE_WRITE_COMPLETION handling.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/async-dev@307380 13f79535-47bb-0310-9956-ffa450edef68
2005-10-09 08:15:40 +00:00
Brian Pane
41f09ddf07 Update new conn_rec field "data_in_output_filters" in core output filter
so async MPMs can tell whether to keep polling and writing


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/async-dev@307379 13f79535-47bb-0310-9956-ffa450edef68
2005-10-09 07:43:23 +00:00
Brian Pane
bc110b3e7a cleaned up the timeout management in ap_core_output_filter()
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/async-dev@307371 13f79535-47bb-0310-9956-ffa450edef68
2005-10-09 05:43:08 +00:00
Brian Pane
e7d300d318 Refactored ap_process_request() so that in async MPMs, the MPM (and not
the httpd core) is responsible for write completion.

Note that, with this commit, the Event MPM is still doing write
completion synchronously.  I'll add async write completion as a
separate commit.

Note also that this commit breaks the (experimental) Leader/Followers
MPM on the (equally experimental) async-dev branch.  The fix is to add
either synchronous or asynchronous write completion to that MPM.  Rather
than hack in synchronous write completion, I'll revisit Leader/Followers
once I have async working in Event.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/async-dev@307362 13f79535-47bb-0310-9956-ffa450edef68
2005-10-09 04:49:52 +00:00
Brian Pane
d946febd16 Added mod_logio hooks to the new, nonblocking version of
ap_core_output_filter()


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/async-dev@307344 13f79535-47bb-0310-9956-ffa450edef68
2005-10-09 02:32:17 +00:00
Brian Pane
bd34a1bc19 Redesign of request cleanup:
- A new End-Of-Request bucket is pushed through the output filter
    chain after the last bucket of the response.
  - This bucket gets destroyed by ap_core_output_filter() after the
    buckets in front of it have been sent.
  - The destroy callback of the EOR bucket invokes the access logger
    and frees the request's pool.

With this change, the request logger now runs after the last byte of
the response is _sent_, rather than after the last byte of the response
is _generated_.  This should make the bytes-sent count in the access
log more accurate in cases where the client closes the connection
midway through the sending of the response.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/async-dev@307339 13f79535-47bb-0310-9956-ffa450edef68
2005-10-09 01:37:11 +00:00
Brian Pane
06809b3c3f Forward-port of the latest event MPM code from the 2.3-dev trunk into
the async-dev branch


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/async-dev@307334 13f79535-47bb-0310-9956-ffa450edef68
2005-10-08 23:53:51 +00:00
Brian Pane
1000a35949 Forward-port of wrowe's NET_TIME filter removal/refactor into
the async-dev branch, in preparation for developing async write
completion in this branch on top of the new timeout design.
http://svn.apache.org/viewcvs.cgi?rev=306495&view=rev


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/async-dev@306541 13f79535-47bb-0310-9956-ffa450edef68
2005-10-06 06:19:12 +00:00
Brian Pane
846cbeee1c port the fix for PR35292 forward from the 2.3 trunk to the async-dev branch, because one of the perl-framework test cases now checks for this fix
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/async-dev@306540 13f79535-47bb-0310-9956-ffa450edef68
2005-10-06 06:13:39 +00:00
Brian Pane
b821e76412 New version of ap_core_output_filter...
The big change is that it now does nonblocking writes when possible.  The
goal of this redesign is to more cleanly support asynchronous write completion
in MPMs such as Event or Leader.  However, the nonblocking writes may also
help in Worker and Prefork by allowing more overlapping of handler and
output filter processing with network writes.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/async-dev@291377 13f79535-47bb-0310-9956-ffa450edef68
2005-09-25 05:22:04 +00:00
Brian Pane
188f4af37a Ported fix for PR35330 forward from the trunk (This particular patch doesn't
interact with the async R&D, but I'm merging it into the async-dev branch
because there's now a test case specifically for this change in
httpd-test/perl-framework.)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/async-dev@291354 13f79535-47bb-0310-9956-ffa450edef68
2005-09-25 01:35:18 +00:00
Brian Pane
926f1e0ab3 Added asynchronous keep-alive support to the leader MPM...
the new io_multiplexer object is intended to provide a
foundation for async processing of the other connection
states.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/async-dev@280222 13f79535-47bb-0310-9956-ffa450edef68
2005-09-12 00:35:23 +00:00
Brian Pane
d1ff1de803 Added new connection states CONN_STATE_HANDLER and CONN_STATE_WRITE_COMPLETION.
Also, core_create_conn() now initializes the conn_state within the newly
created connection.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/async-dev@280221 13f79535-47bb-0310-9956-ffa450edef68
2005-09-12 00:29:10 +00:00
Paul Querna
9c05049bff *) Create an optional function and MPM Query to replace the core output filter.
*) Put an example of using it into the Event MPM, which just calls the original core output filter.  


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/async-dev@278652 13f79535-47bb-0310-9956-ffa450edef68
2005-09-05 00:21:25 +00:00
Jeff Trawick
aa6fdd0e52 httpd.exe/apachectl -V: display the DYNAMIC_MODULE_LIMIT setting
(1.3 has done that for a while)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@265737 13f79535-47bb-0310-9956-ffa450edef68
2005-09-01 14:21:38 +00:00
Joe Orton
38454d45fe * server/listen.c (open_listeners): Avoid shadowing the 'next'
variable at function-scope.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@265701 13f79535-47bb-0310-9956-ffa450edef68
2005-09-01 11:55:31 +00:00
Colm MacCarthaigh
cc841a28e5 Initiliase all of the first_*_limit variables to zero, so that we can actually
raise limits beyond their defaults reliably. 



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@265523 13f79535-47bb-0310-9956-ffa450edef68
2005-08-31 16:10:55 +00:00
Colm MacCarthaigh
106fdaa568 Revert one part. I should have tested seperately. This line isn't neccessary.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@265519 13f79535-47bb-0310-9956-ffa450edef68
2005-08-31 16:04:25 +00:00
Colm MacCarthaigh
cef7ca9fe6 Actually allow the admin to set thread_limit higher than the default.
Also, initialise the first_ variables, since they are tested in the
set_ functions.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@265518 13f79535-47bb-0310-9956-ffa450edef68
2005-08-31 16:01:13 +00:00
Jim Jagielski
d81de0d9b3 Add ap_append_pid(); This is performed enough to warrant
a function I think, especially with the fact that
the mapping of getpid() to APR_PID_T_FMT isn't
consistant in some areas. 


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@265506 13f79535-47bb-0310-9956-ffa450edef68
2005-08-31 15:22:08 +00:00
Jim Jagielski
1df26ab1bb More getpid format fixes
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@265504 13f79535-47bb-0310-9956-ffa450edef68
2005-08-31 15:18:54 +00:00
Joe Orton
5f64e4f136 * server/main.c (suck_in_APR): Remove weird gzeof reference which
broke all the -Werror builds.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@264886 13f79535-47bb-0310-9956-ffa450edef68
2005-08-30 22:53:37 +00:00
Colm MacCarthaigh
146fd39a5a Implement graceful stop in the event MPM. Implementation is identical to
the worker MPM implementation. 



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@264105 13f79535-47bb-0310-9956-ffa450edef68
2005-08-29 10:20:25 +00:00
Colm MacCarthaigh
36b3643d82 *how* did I mis-spell that.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@264104 13f79535-47bb-0310-9956-ffa450edef68
2005-08-29 09:38:33 +00:00
Colm MacCarthaigh
5a0531c52e Move the "GracefulShutdownTimeout" command definition into mpm_common
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@264103 13f79535-47bb-0310-9956-ffa450edef68
2005-08-29 09:28:27 +00:00
Ian Holsman
8c1e315d3f Doxygen fixup / cleanup
submited by: Neale Ranns neale ranns.org
reviewed by: Ian Holsman



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@263931 13f79535-47bb-0310-9956-ffa450edef68
2005-08-28 23:03:59 +00:00
Colm MacCarthaigh
fec621ccba Implement a graceful-stop for the worker MPM. We close our listeners, and then
ask each child process to do the same. We then monitor until all children have
exited.

The change to ap_start_shutdown(void) to ap_start_shutdown(int) may look like
an external API change, but the function is defined static, and used only in
one place.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@241819 13f79535-47bb-0310-9956-ffa450edef68
2005-08-27 23:22:50 +00:00
Colm MacCarthaigh
b4b88ed365 Re-add a simple, obvious, speed-up.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@241814 13f79535-47bb-0310-9956-ffa450edef68
2005-08-27 23:04:17 +00:00
Colm MacCarthaigh
04558bec28 Remove as many ghastly scoreboard loops from the graceful-shutdown code, and
replace with the new ap_relieve_child_processes() call. Add a sleep() call now,
as we lost the timeout inherent in ap_wait_or_timeout(). 1 second seems a sane
choice.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@240466 13f79535-47bb-0310-9956-ffa450edef68
2005-08-27 22:16:46 +00:00
Colm MacCarthaigh
a500939eb8 Add ap_relieve_child_processess(), a non-infanticidal copy of
ap_reclaim_child_processes(). Allows us to waitpid() each process in the
scoreboard and each "extra" process with a single call.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@240465 13f79535-47bb-0310-9956-ffa450edef68
2005-08-27 22:12:08 +00:00
Colm MacCarthaigh
d7c04b158c Move the "GracefulShutdownTimeout" directive into mpm_common, for re-use
with other MPM's.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@240296 13f79535-47bb-0310-9956-ffa450edef68
2005-08-26 17:43:24 +00:00
Colm MacCarthaigh
c6fb6c57d0 Implement a "graceful-stop" for the prefork MPM (might aswell do the hard one
first). 

General approach is to send SIGUSR1 to all children (which will de-listen, and
exit when finished), and to gather all children as they exit. 

We don't use a sleep(timeout) for the timeout implementation, because this
would lead to a rut of defunct children until the timeout had expired.

set_graceful_shutdown stolen from Ken Coar. See <3E84B1EC.3050007@Golux.Com>
(28 Mar 2003).



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@240270 13f79535-47bb-0310-9956-ffa450edef68
2005-08-26 16:09:54 +00:00
Colm MacCarthaigh
432af0071e Make the neccessary changes to mpm_common and main to support a graceful-stop
command line argument. 



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@240269 13f79535-47bb-0310-9956-ffa450edef68
2005-08-26 16:00:59 +00:00
Joe Orton
67e8ce3fc8 * server/listen.c (open_listeners): If 0.0.0.0 is found before [::]
for the same port, switch them so that the bind to [::] is attempted
first.

Submitted by: colm, jorton


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@240096 13f79535-47bb-0310-9956-ffa450edef68
2005-08-25 15:56:43 +00:00
Joe Orton
4f75bd3508 * server/listen.c (IS_INADDR_ANY, IS_IN6ADDR_ANY): New macros.
(open_listeners): Simplify using the new macros; no functional change.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@240092 13f79535-47bb-0310-9956-ffa450edef68
2005-08-25 15:37:39 +00:00
Colm MacCarthaigh
cdb2935300 Implement "de-listening" in the worker MPM. Fixes PR28167. Comments in CHANGES
file also cover r239710-1. 



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@239740 13f79535-47bb-0310-9956-ffa450edef68
2005-08-24 19:37:46 +00:00
Colm MacCarthaigh
ea08df890e Correct the function prototype/declaration
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@239732 13f79535-47bb-0310-9956-ffa450edef68
2005-08-24 19:06:40 +00:00
Colm MacCarthaigh
aacf3609d2 Implement "de-listening" for graceful restarts with the prefork MPM. With this
change;

  1.) httpd -k graceful sends SIGUSR1 to the parent pid, which in turn
      sends SIGUSR1 to all of the active children,

  2.) Active children each close their copy of listener fd's.

This means that the listening sockets are freed for re-use. In the ordinary
case, this makes no difference. However if for example admin changes "Listen
80" to "Listen 81" in the config, this rev makes port 80 immediately available
(no waiting for the graceful children to die).



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@239711 13f79535-47bb-0310-9956-ffa450edef68
2005-08-24 16:58:11 +00:00
Colm MacCarthaigh
d6f8c966b0 Provide a function for closing all of the listeners.
* This is useful for properly implementing a graceful stop and restart
    where we want child processess to be able to carry on serving a request 
    but "de-listen" from a port. So that another instance entirely can be 
    started in our place, or to unbind from a "Listen" directive an admin 
    has removed from the configuration.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@239710 13f79535-47bb-0310-9956-ffa450edef68
2005-08-24 16:51:20 +00:00
Colm MacCarthaigh
395896ae8d Remove support for the threaded-mpm's on Linux 2.0, and de-autoconf the
graceful restart signal. Frees up SIGWINCH for implementing graceful stop.
See <20050727114058.GA3390@stdlib.net> and subsequent thread on httpd-dev.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@239430 13f79535-47bb-0310-9956-ffa450edef68
2005-08-23 16:41:17 +00:00
Paul Querna
cc2db72ca1 Add a User-Agent to the dummy connection code to ease admin debugging.
Submitted By: Colm MacCarthaigh <colm stdlib.net>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@230808 13f79535-47bb-0310-9956-ffa450edef68
2005-08-08 14:37:14 +00:00
Joe Orton
675c62c505 * server/vhost.c (get_addresses): Fix double negative and make errors
consistent; thanks Joshua.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@230469 13f79535-47bb-0310-9956-ffa450edef68
2005-08-05 13:49:07 +00:00
Joe Orton
8b92612278 * server/vhost.c (get_addresses): Fail with an error message rather
than an assert() for errors which plague users on Solaris boxes which
don't have a properly configured resolver.

PR: 27525


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@230453 13f79535-47bb-0310-9956-ffa450edef68
2005-08-05 12:27:57 +00:00
Joe Orton
7754d8254f * server/util_pcre.c (ap_regexec): Fix --with-pcre build with older
versions of pcre.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@227189 13f79535-47bb-0310-9956-ffa450edef68
2005-08-03 09:45:57 +00:00
William A. Rowe Jr
025c799a79 Initially a no-op. Add trace_enable configuration. The http and proxy
flavors of interpreting this flag are yet to be committed.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@208785 13f79535-47bb-0310-9956-ffa450edef68
2005-07-01 19:39:26 +00:00