1
0
mirror of https://github.com/apache/httpd.git synced 2025-11-06 16:49:32 +03:00
Commit Graph

359 Commits

Author SHA1 Message Date
Stefan Fritsch
ab7b448082 Fix segfault caused by r1204104 on non-async mpms.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1204180 13f79535-47bb-0310-9956-ffa450edef68
2011-11-20 16:41:42 +00:00
Stefan Fritsch
40ac38ff05 Remove MPM-private stuff from conn_state_t
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1204104 13f79535-47bb-0310-9956-ffa450edef68
2011-11-19 23:35:46 +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
Stefan Fritsch
2d4e23d88b Create wrapper API for apr_random;
use in mod_lbmethod_heartbeat and mod_serf to
- replace some needles use of apr_generate_random_bytes
- remove code duplication


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1171247 13f79535-47bb-0310-9956-ffa450edef68
2011-09-15 19:53:59 +00:00
Stefan Fritsch
fba947527f Introduce new function ap_get_conn_socket() to access the socket of
a connection


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1135153 13f79535-47bb-0310-9956-ffa450edef68
2011-06-13 16:02:18 +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
Stefan Fritsch
ebb62867fb Use the new APLOG_USE_MODULE/AP_DECLARE_MODULE macros everywhere to take
advantage of per-module loglevels


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@951895 13f79535-47bb-0310-9956-ffa450edef68
2010-06-06 16:59:50 +00:00
Takashi Sato
b5a24b1d4f KeepAlive no longer accepts other than On|Off.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@883082 13f79535-47bb-0310-9956-ffa450edef68
2009-11-22 14:30:50 +00:00
Stefan Fritsch
702b9ec34d Use the new ap_update_child_status_from_conn() to put the client IP into the
scoreboard (and show it in mod_status) as soon as we start reading the request.

Empty the vhost and request fields in ap_update_child_status_from_conn so that
mod_status does not display outdated data if the connection closes without
the request being completely read.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@826530 13f79535-47bb-0310-9956-ffa450edef68
2009-10-18 21:38:35 +00:00
Jeff Trawick
b6652d949e handle an unfortunate implication of loadable MPMs:
calls to ap_mpm_query() must be deferred until after the register-hooks hook, since that's 
where the MPM registers its mpm-query hook


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@761226 13f79535-47bb-0310-9956-ffa450edef68
2009-04-02 10:05:39 +00:00
Takashi Sato
5585fc8d5b Enhance KeepAliveTimeout to support a value in milliseconds.
PR: 46275

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@733557 13f79535-47bb-0310-9956-ffa450edef68
2009-01-12 00:52:26 +00:00
Paul Querna
767cc30c02 Introduce Suspendable Requests to the Event MPM.
Using this basic framework, you can return SUSPENDED from an HTTP Handler,
and then register a callback that is invoked by the MPM at a later time.

This initial version only supports _timers_ as callbacks, but in the future I
would like to add things like wait for socket activity, on a socket specified by
the handler.

Once in a callback, It is then the responsibility of the callback fucntion 
to finish the HTTP Request handling, but this alows you to do cool things like 
a fully async proxy, COMET support, or even rate limiting.

To prove I'm not insane, I've inlcuded an example module, mod_dialup.

You can configure it like this:
<Location "/docs">
  ModemStandard "V.32"
</Location>

And for static files inside that path, you will be rate limited to V.32 speeds, 
aka 9.6 kilobits/second.

Does anyone besides Rüdiger read commit emails :-) ?

I know there are likely huge problems with this, but I would like to see how far
we can push the Event MPM, figure out what to do better, if there is anything, 
and then really dive into the 3.0 development before ApacheCon.

* server/mpm/experimental/event/fdqueue.h:
    (timer_event_t): New structure to hold timer events and callback functions.
    
* server/mpm/experimental/event/fdqueue.c
    (ap_queue_empty): Modify to also look at Timer Ring.

    (ap_queue_init): Initialize Timer Ring.

    (ap_queue_push_timer): New function, pushes a timer event into the queue.

    (ap_queue_pop_something): Renamed function, returns a timer event or
        a socket/pool for a worker thread to run.


* server/mpm/experimental/event/event.c
    (process_socket): If the connection is in SUSPENDED state, don't force it
        into linger mode yet, the callback will have to take care of that.

    (push_timer2worker): New shortcut function, pushes timer event into queue
        for a worker to run.

    (timer_free_ring): New global data structure to recycle memory used by 
        timer events.

    (timer_ring): New global data structure to hold active timer events.

    (g_timer_ring_mtx): Thread mutex to protect timer event data structures.

    (ap_mpm_register_timed_callback): New Function, registers a callback to be
        invoked by the MPM at a later time.

    (listener_thread): Calculate our wakeup time based on the upcoming Event 
        Queue, and after pollset_poll runs, push any Timers that have passed
        onto worker threads to run.
    
    (worker_thread): Call new queue pop method, and if the Timer Event is 
        non-null, invoke the callback.  Once the callback is done, push the
        structure onto the timer_free_ring, to be recycled.

    (child_main): Initialize new mutex and ring structures.


* server/config.c
    (ap_invoke_handler): Allow SUSPENDED aa valid return code from handlers.


* modules/http/http_core.c
    (ap_process_http_async_connection): Don't close the connection when in 
        SUSPENDED state.


* modules/http/http_request.c
    (ap_process_request_after_handler): New function, body pulled from the old,
        ap_process_async_request.  Split to let handlers invoke this so they 
        don't need to know all of the details of finishing a request.

    (ap_process_async_request): If the handler returns SUSPENDED, don't do
        anything but return.


* include/ap_mmn.h: Bump MMN.


* include/ap_mpm.h
    (ap_mpm_register_timed_callback): New function.


* include/httpd.h:
    (SUSPENDED): New return code for handlers.
    (request_rec::invoke_mtx): New mutex to protect callback invokcations
        from being run before the original handler finishes running.
    (conn_state_e): Add a suspended state.


* include/http_request.h
    (ap_process_request_after_handler): New function to make it easier for 
        handlers to finish the HTTP Request.


* modules/test/config.m4: Add mod_dialup to build.


* modules/test/mod_dialup.c: New rate limiting module, requires the Event MPM 
    to work.




git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@697357 13f79535-47bb-0310-9956-ffa450edef68
2008-09-20 11:58:08 +00:00
Graham Leggett
b613588a30 Move the KeptBodySize directive, kept_body filters and the
ap_parse_request_body function out of the http module and into a
new module called mod_request, reducing the size of the core.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@647263 13f79535-47bb-0310-9956-ffa450edef68
2008-04-11 18:41:53 +00:00
Guenter Knauf
3e2c24c781 NO var declarations in the middle of the code.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@645875 13f79535-47bb-0310-9956-ffa450edef68
2008-04-08 12:30:05 +00:00
Paul Querna
a324a1d72f Remove all references to CORE_PRIVATE.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@645455 13f79535-47bb-0310-9956-ffa450edef68
2008-04-07 10:45:43 +00:00
Paul Querna
064a1ffbff Remove calls to ap_graceful_stop_signalled, and replace by using ap_mpm_query
to determine if the MPM is trying to stop the process.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@645434 13f79535-47bb-0310-9956-ffa450edef68
2008-04-07 09:53:58 +00:00
William A. Rowe Jr
a8d0009e5c If you study all of the directive implementations, you'll note
that we get less than 20% of the NOT_IN_LIMIT rules correct.

<Limit > works in about 4 directive contexts and yet, we ignore
this fact for 100's of directives.  Simply eliminate this
nonsense in anticipation of a 100% solution.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@645189 13f79535-47bb-0310-9956-ffa450edef68
2008-04-06 00:42:21 +00:00
Graham Leggett
a6d30e317a core: Add the option to keep aside a request body up to a certain
size that would otherwise be discarded, to be consumed by filters
such as mod_include. When enabled for a directory, POST requests
to shtml files can be passed through to embedded scripts as POST
requests, rather being downgraded to GET requests.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@592951 13f79535-47bb-0310-9956-ffa450edef68
2007-11-07 23:31:03 +00:00
Jim Jagielski
2213956049 Ensure the URI is "*" and not something like "*foo"
Oh, last commit was supposed to say we need to return
DONE so we don't invoke any handlers.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@581389 13f79535-47bb-0310-9956-ffa450edef68
2007-10-02 21:21:04 +00:00
Jim Jagielski
b89d1b6d85 We should return
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@581388 13f79535-47bb-0310-9956-ffa450edef68
2007-10-02 21:16:00 +00:00
Roy T. Fielding
97f37ce377 Reduce the last change to a minimum, since OPTIONS * does not
include an Allow header field (* is not a resource).



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@581374 13f79535-47bb-0310-9956-ffa450edef68
2007-10-02 20:36:47 +00:00
Jim Jagielski
5773c94270 OPTIONS * does not map to storage, so handle this
as appropriate. For other Request URIs, we drop
down the the default_handler to do that for us.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@581359 13f79535-47bb-0310-9956-ffa450edef68
2007-10-02 19:29:36 +00:00
Paul Querna
dc08a1050d Fixup style nitpicks:
- Empty lines should not have spaces
 - Declare static functions in http_core.c at the top.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@546632 13f79535-47bb-0310-9956-ffa450edef68
2007-06-12 20:55:57 +00:00
Paul Querna
83a3e2a77f Add a clogging_input_filters variable to the conn_rec, enabling the Event MPM to know when its running with an input filter that buffers its own data, like mod_ssl.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@546328 13f79535-47bb-0310-9956-ffa450edef68
2007-06-12 00:32:24 +00:00
Roy T. Fielding
de659cbed0 update license header text
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@420983 13f79535-47bb-0310-9956-ffa450edef68
2006-07-11 20:33:53 +00:00
Sander Temme
646a8ad3c8 Add optional 'scheme://' prefix to ServerName directive. For
'https', mod_http returns "https" for the ap_hook_http_scheme and
     DEFAULT_HTTPS_PORT for ap_hook_default_port.  This fixes Redirect
     responses to requests for directories without a trailing slash
     when httpd runs behind a proxy or offload device that processes
     SSL.  It also enables support for Subversion in that
     configuration.  This change is completely backwards compatible
     and passes the perl-framework.  Minor mmn bump because I add a
     field to server_rec. 


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@399947 13f79535-47bb-0310-9956-ffa450edef68
2006-05-05 04:17:36 +00:00
Colm MacCarthaigh
dd95d7c37c Update the copyright year in all .c, .h and .xml files
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@395228 13f79535-47bb-0310-9956-ffa450edef68
2006-04-19 12:11:27 +00:00
Jim Jagielski
d4f879aefa Morph the ap_http_broken_backend_filter() proxy "specific"
filter to a generic http error handling output filter.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@358022 13f79535-47bb-0310-9956-ffa450edef68
2005-12-20 15:50:37 +00:00
Ruediger Pluem
90089065b6 * Move code for broken backend detection out of core filter into a new http
protocol filter (ap_http_broken_backend_filter) that is only run in the
  proxy case.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@357519 13f79535-47bb-0310-9956-ffa450edef68
2005-12-18 22:09:05 +00:00
Jim Jagielski
08c97ba290 No functional change: remove "internal" tab spacing/formatting.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@345053 13f79535-47bb-0310-9956-ffa450edef68
2005-11-16 16:31:25 +00:00
Jim Jagielski
5061d9fa92 No functional Change: Removing trailing whitespace. This also
means that "blank" lines consisting of just spaces or
tabs are now really blank lines


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@332306 13f79535-47bb-0310-9956-ffa450edef68
2005-11-10 15:11:44 +00:00
Jim Jagielski
5d2fae4818 No functional change: simple detabbing of indented code.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@332305 13f79535-47bb-0310-9956-ffa450edef68
2005-11-10 15:05:51 +00:00
Brian Pane
5a653ac440 Moved the extended_status scoreboard update from ap_process_http_connection
to the EOR bucket destructor.  Also, added some defensive code and comments
regarding r->pool lifetime to ap_process_http_connection.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@329664 13f79535-47bb-0310-9956-ffa450edef68
2005-10-30 22:55:35 +00:00
Brian Pane
cb0e5db86f Async write completion for Event MPM
(backported from async-dev branch to 2.3 trunk)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@327945 13f79535-47bb-0310-9956-ffa450edef68
2005-10-24 03:33:14 +00:00
Brian Pane
158559eacb Redesign of request cleanup and logging to use End-Of-Request bucket
(backport from async-dev branch to 2.3 trunk)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@327925 13f79535-47bb-0310-9956-ffa450edef68
2005-10-24 02:39:49 +00:00
Brian Pane
4db6998015 Add new connection states for handler and write completion
(backport from async-dev branch to 2.3 trunk)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@327870 13f79535-47bb-0310-9956-ffa450edef68
2005-10-23 22:20:59 +00:00
William A. Rowe Jr
7e2a5490d1 NET_TIME, as a standalone feature, was a horrid idea.
The core filter will NOT operate correctly across platforms 
  (even between Linux/Solaris) without setting up the conn->timeout,
  so always apply the timeout when establishing the core filter.

  The keep-alive-timeout is entirely an HTTP-ism, and needs to
  move to the http protocol handler.  Note #1; this isn't triggered
  in the event mpm, but the event mpm introspects s->keep_alive_timeout
  directly adding it to the pollset, so this is a non-sequitor.

  Finally, once the headers are read, the named virtual host may
  have a different (more/less permissive) timeout for the remainder
  of the request body.  This http-centric patch picks up that subtle
  detail and can switch to a named-vhost timeout.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@306495 13f79535-47bb-0310-9956-ffa450edef68
2005-10-06 01:29:42 +00:00
William A. Rowe Jr
e279db098e Spare us a wasted variable, csd is initialized null, acting
as the 'csd_set' indicator.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@300198 13f79535-47bb-0310-9956-ffa450edef68
2005-10-06 00:46:23 +00:00
Justin Erenkrantz
905cdf9f0b Update copyright year to 2005 and standardize on current copyright owner line.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@151408 13f79535-47bb-0310-9956-ffa450edef68
2005-02-04 20:28:49 +00:00
William A. Rowe Jr
d962fcfc8b FINALLY Correct ap_http_method()! It is NOT a method, it's a SCHEME!
Bumped mmn, and ap module cookie, for this function rename.

  It's not a deprecation, as ap_http_method would be a lovely function
  name sometime in the future: to determine what the function name implies.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@123882 13f79535-47bb-0310-9956-ffa450edef68
2005-01-02 05:33:44 +00:00
Paul Querna
3afc45863a * Style fixes only. No functional changes. Remove two tabs. Fix an If. Split a String.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@111719 13f79535-47bb-0310-9956-ffa450edef68
2004-12-13 16:13:06 +00:00
Joe Orton
671710004d * modules/http/mod_core.h: Prototype ap_http_chunk_filter.
* modules/http/chunk_filter.c (ap_http_chunk_filter): Rename from
chunk_filter.

* modules/http/http_core.c (chunk_filter): Remove the original copy.
(register_hooks): Register ap_http_chunk_filter.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@109497 13f79535-47bb-0310-9956-ffa450edef68
2004-12-02 13:25:12 +00:00
Greg Ames
b5e9415869 ap_process_http_async_connection (used by the Event MPM):
fix CLOSE_WAITs/leaked connections.  The logic to deal with ap_read_request
failures got lost when merging in the HTTP pipelining fix.  If ap_read_request
fails, the connection state should get set to CONN_STATE_LINGER so the MPM will
invoke lingering close.  Test case: client sends a Connection: keepalive header
then closes the connection before the keepalive timeout pops.

Also add a comment to make the pipelining flow more obvious.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@106662 13f79535-47bb-0310-9956-ffa450edef68
2004-11-26 21:21:42 +00:00
Paul Querna
34959f29db The Event MPM.
Designed to minimize Apache's KeepAlive overhead.

This MPM depends on the current APR-trunk for new features added to 
the apr_pollset interface. Currently the underlying operating
system must support KQueue or EPoll.

Status:
  Should work as a drop in replacement for all non-ssl servers.
  SSL Requests that use HTTP 1.1 Pipelining do not currently work.

Testing:
  I have tested it with Linux 2.6, FreeBSD 5.2.1, and OS X 10.3.
  
Originally based on the patch by Greg Ames.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105919 13f79535-47bb-0310-9956-ffa450edef68
2004-11-20 02:52:36 +00:00
André Malo
a688f06b19 fix name of The Apache Software Foundation
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102618 13f79535-47bb-0310-9956-ffa450edef68
2004-02-09 20:31:03 +00:00
André Malo
d0e05bada9 fix copyright dates according to the first check in
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102565 13f79535-47bb-0310-9956-ffa450edef68
2004-02-08 12:07:22 +00:00
André Malo
4f02cb1e18 apply Apache License, Version 2.0
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102525 13f79535-47bb-0310-9956-ffa450edef68
2004-02-06 22:58:42 +00:00
André Malo
fb07607180 update license to 2004.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102135 13f79535-47bb-0310-9956-ffa450edef68
2004-01-01 13:26:26 +00:00
Cliff Woolley
aaf0424e2b get rid of _FOREACH
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101788 13f79535-47bb-0310-9956-ffa450edef68
2003-11-16 02:09:14 +00:00
Jeff Trawick
013339e87d fix some discrepancies between format strings and arguments,
resolving some warnings on 64-bit systems


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@99374 13f79535-47bb-0310-9956-ffa450edef68
2003-04-15 22:47:58 +00:00