1
0
mirror of https://github.com/apache/httpd.git synced 2025-11-08 04:22:21 +03:00
Commit Graph

299 Commits

Author SHA1 Message Date
Eric Covener
51c4443fcc Prevent AP_FILTER_ERROR from being misinterpreted as SUSPENDED when checking
the status code returned by a handler by updating the values of the filter
error macros and consolidating them in httpd.h 



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@721677 13f79535-47bb-0310-9956-ffa450edef68
2008-11-29 12:57:42 +00:00
Ruediger Pluem
81c73ca116 * Move ap_timeout_parameter_parse from mod_proxy.c to server/util.c and thus
make it part of the public API.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@707022 13f79535-47bb-0310-9956-ffa450edef68
2008-10-22 10:23:52 +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
Greg Ames
66c1fe1649 The response to the TRACE method is partially garbled on an EBCDIC platform.
Send the request line and trailing CRLF in ASCII.

Submitted by:           David Jones <oscaremma gmail.com>
Reviewed and tested by: gregames


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@659560 13f79535-47bb-0310-9956-ffa450edef68
2008-05-23 14:52:33 +00:00
Paul Querna
5e415009f3 Remove CORE_PRIVATE.
This define serves no modern purpose, since every module in the wild, including 
our own define it, for no purpose.

If you have functions which you do not want in the 'public' API, put them
in a private header, that is not installed, just like mod_ssl does.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@645412 13f79535-47bb-0310-9956-ffa450edef68
2008-04-07 08:44:14 +00:00
Graham Leggett
f05f1f9bbc Rename the ap_escape_path_segment_b function as suggested by
Ruediger Pluem, and make a corresponding minor bump.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@645120 13f79535-47bb-0310-9956-ffa450edef68
2008-04-05 15:26:03 +00:00
Graham Leggett
2b7c89aab4 mod_session: Add a generic session interface to unify the different
attempts at saving persistent sessions across requests.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@644746 13f79535-47bb-0310-9956-ffa450edef68
2008-04-04 15:58:15 +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
Nick Kew
a5e74932ad Add "DefaultType None" option
PR 13986 and PR 16139


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@579991 13f79535-47bb-0310-9956-ffa450edef68
2007-09-27 12:43:42 +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
Nick Kew
51102dd25a Generic fix for PR#31759
If a handler returns a value that is neither reserved nor a valid
HTTP response code, log an error and substitute HTTP_INTERNAL_SERVER_ERROR.
Allow a handler to override this explicitly by setting a note.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@448711 13f79535-47bb-0310-9956-ffa450edef68
2006-09-21 22:13:34 +00:00
Jeff Trawick
743a621e8d Replace ap_get_server_version with ap_get_server_banner() and
ap_get_server_description().

High-level summary:

The full server version information is now included in the error log at
startup as well as server status reports, irrespective of the setting
of the ServerTokens directive.

Third-party modules must now use ap_get_server_banner() or 
ap_get_server_description() in place of ap_get_server_version().



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@440337 13f79535-47bb-0310-9956-ffa450edef68
2006-09-05 13:08:15 +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
Brian Pane
761ef9ee17 Revert the refactoring of the request read code
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@381679 13f79535-47bb-0310-9956-ffa450edef68
2006-02-28 15:49:24 +00:00
Brian Pane
0aece3ad6c Refactoring of ap_read_request() to store partial request state
in the request rec.  The point of this is to allow asynchronous
MPMs do do nonblocking reads of requests.  (Backported from the
async-read-dev branch)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@360461 13f79535-47bb-0310-9956-ffa450edef68
2005-12-31 23:45:11 +00:00
Joe Orton
c5f0781f16 * include/httpd.h (conn_state_e): Remove trailing comma from enum.
Submitted by: Per Olausson <pao darkheim.freeserve.co.uk>
PR: 37840


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@355143 13f79535-47bb-0310-9956-ffa450edef68
2005-12-08 17:12:36 +00:00
Brian Pane
05537e381e New version of ap_core_output_filter that does nonblocking writes
(backport from async-dev branch to 2.3 trunk)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@327872 13f79535-47bb-0310-9956-ffa450edef68
2005-10-23 22:38:35 +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
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
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
Rich Bowen
6efa778213 As discussed on the list, change the default setting for
KeepAliveTimeout from 15 seconds to 5 seconds.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@161140 13f79535-47bb-0310-9956-ffa450edef68
2005-04-13 01:21:11 +00:00
Paul Querna
e2d4550b9d *) include/httpd.h: Add a brigade for temporary uses in the core input filter context.
*) server/core_filters.c: Do not use brigade_split, since it allocates a new brigade. Instead move buckets to our tmpbb, and reuse the tmpbb for every call.

PR: 33382


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@154200 13f79535-47bb-0310-9956-ffa450edef68
2005-02-17 22:53:07 +00:00
Joe Orton
1184182659 * include/httpd.h: Fix a comment.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@153408 13f79535-47bb-0310-9956-ffa450edef68
2005-02-11 15:03:12 +00:00
Joe Orton
27759dec9a * include/ap_regex.h: Include apr.h not stdlib.h; replace pointless
regoff_t typedef with int; s/size_t/apr_size_t/;.  Comment fixes.

* server/util_pcre.c: s/size_t/apr_size_t/.

* include/httpd.h: Include stdlib.h here instead since many other
files assume it was included by httpd.h at some point.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@153407 13f79535-47bb-0310-9956-ffa450edef68
2005-02-11 14:57:34 +00:00
Joe Orton
a0570c8746 Move the POSIX reg* implementations into the ap_* namespace;
internalise the ap_reg*<->PCRE wrapper:

* configure.in: Add srclib/pcre to the include path.

* include/ap_regex.h: Renamed from include/pcreposix.h.  Prefix all
constants with AP_; prefix all functions and types with ap_.  Define
AP_DECLARE to nothing if necessary.  Remove regcomp error codes.

* include/httpd.h: Include ap_regex.h not pcreposix.h.
(ap_pregcomp, ap_regexec, ap_regfree): s/regex_t/ap_regex_t/.
(ap_regexec, ap_regerror): Prototypes moved to ap_regex.h.

* server/util.c (regex_cleanup, ap_pregcomp, ap_pregsub, ap_pregfree):
Adjust for ap_ prefixed types.  (ap_regexec, ap_regerror): Removed.

* server/Makefile.in: Build util_pcre.c.

* server/util_pcre.c: Copied from srclib/pcre/pcreposix.c; remove use
of PCRE-internals to do error mapping; rename types to add AP_/ap_
prefixes as above.  Use APR includes.  (ap_regerror): Use apr_snprintf.

* srclib/pcre/Makefile.in: Don't build pcreposix.c into libpcre.la.

* modules/*: Update to use new type and constant names.

PR: 27750 (part one)
Submitted by: Andres Salomon <dilinger voxel.net>, Joe Orton


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@153384 13f79535-47bb-0310-9956-ffa450edef68
2005-02-11 12:00:41 +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
Geoffrey Young
78c1d9dc3e undo changes made in 111386 due to veto
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@111432 13f79535-47bb-0310-9956-ffa450edef68
2004-12-09 21:09:26 +00:00
Geoffrey Young
fe1bfd7775 add response code 226 constant (HTTP_IM_USED) and status
line ("226 IM Used").  PR 31128.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@111386 13f79535-47bb-0310-9956-ffa450edef68
2004-12-09 14:16:16 +00:00
William A. Rowe Jr
2ecaddd6a1 Revert my patch of this a.m. while I work out all the
potential forward declaration pitfalls.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@106955 13f79535-47bb-0310-9956-ffa450edef68
2004-11-29 21:34:41 +00:00
William A. Rowe Jr
d6a9f1c620 Usage was inconsistent with the rest of ap_filter_t examples;
we always presume the typedef'fed flavor of such symbol names.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@106932 13f79535-47bb-0310-9956-ffa450edef68
2004-11-29 17:41:49 +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
Roy T. Fielding
c76dd4ecef veto and revert win64 patch: 64bit changes must percolate from the
bottom (APR/system) up -- we can't give the client a 64bit API and
then cast it to 32bits internally without introducing security holes
on other platforms.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105572 13f79535-47bb-0310-9956-ffa450edef68
2004-10-23 22:39:53 +00:00
Allan K. Edwards
6c775f9a3c WIN64: API changes to clean up Windows 64bit compile warnings
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105545 13f79535-47bb-0310-9956-ffa450edef68
2004-10-22 15:22:05 +00:00
Stas Bekman
d60aa10075 correct struct fields comments
PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@104633 13f79535-47bb-0310-9956-ffa450edef68
2004-08-12 05:22:59 +00:00
Paul Querna
9d66007aa2 Added 'AllowOverride Options=Indexes,MultiViews' to give an admin better
control over what options can be used in .htaccess files.

PR: 29310
Submitted by: Tom Alsberg <alsbergt-apache cs.huji.ac.il>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@104283 13f79535-47bb-0310-9956-ffa450edef68
2004-07-14 06:36:42 +00:00
Joe Orton
995a925a3f * include/httpd.h: Double DYNAMIC_MODULE_LIMIT, httpd alone includes
about 60 modules already.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102777 13f79535-47bb-0310-9956-ffa450edef68
2004-02-26 13:32:34 +00:00
André Malo
eeb57c17ad fix name of The Apache Software Foundation
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102619 13f79535-47bb-0310-9956-ffa450edef68
2004-02-09 20:40:53 +00:00
André Malo
129635b965 fix copyright dates according to the first check in
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102548 13f79535-47bb-0310-9956-ffa450edef68
2004-02-07 19:27:57 +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
02bc2a93e8 Add core version query function ap_get_server_revision and
accompanying ap_version_t structure (minor MMN bump).
The function is similar to apr_version() and allow for exact
querying of the core revision level.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102405 13f79535-47bb-0310-9956-ffa450edef68
2004-01-25 22:03:38 +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
André Malo
c4511308ee fix docco
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102058 13f79535-47bb-0310-9956-ffa450edef68
2003-12-14 16:34:18 +00:00
André Malo
a7db87b9ad SECURITY [CAN-2003-0020]: escape arbitrary data before writing into the
errorlog.

Reviewed by: Mark J Cox


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101873 13f79535-47bb-0310-9956-ffa450edef68
2003-11-24 21:34:38 +00:00
Cliff Woolley
e269230c3b fix comment
Submitted by:	Fitz


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101870 13f79535-47bb-0310-9956-ffa450edef68
2003-11-24 16:08:44 +00:00
André Malo
1694aa9b06 - add XHTML doctypes to httpd.h
- fix the (x)html output of mod_autoindex to be consistent
  and make it configurable to emit either HTML or XHTML

PR: 23747


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101683 13f79535-47bb-0310-9956-ffa450edef68
2003-11-02 20:37:04 +00:00
Sander Striker
67a3a71877 Fold in the CAN-2003-0542 regex patch.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101556 13f79535-47bb-0310-9956-ffa450edef68
2003-10-24 16:20:28 +00:00