Commit Graph

68 Commits

Author SHA1 Message Date
1951a037bf More cleanup: Expand tabs and some more indentation fixes
No functional change


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1174929 13f79535-47bb-0310-9956-ffa450edef68
2011-09-23 18:08:42 +00:00
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
20633f6349 Avoid "`sentinel' attribute directive ignored" warning with gcc 3.x
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1134906 13f79535-47bb-0310-9956-ffa450edef68
2011-06-12 10:40:17 +00:00
328e833e41 Add __attribute__((sentinel)) to a few functions that require a terminal NULL
argument.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1131467 13f79535-47bb-0310-9956-ffa450edef68
2011-06-04 19:00:16 +00:00
2aef21903c Cleanup... most don't need apr_hooks.h at all...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1101067 13f79535-47bb-0310-9956-ffa450edef68
2011-05-09 15:36:32 +00:00
a38d3c9e23 Merge the <If> sections in a separate step ap_if_walk, after ap_location_walk.
This makes <If> apply to all requests, not only to file base requests and
it allows to use <If> inside <Directory>, <Location>, and <Files> sections.

The merging of <If> sections always happens after the merging of <Location>
sections, even if the <If> section is embedded inside a <Directory> or
<Files> section.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1059867 13f79535-47bb-0310-9956-ffa450edef68
2011-01-17 11:02:38 +00:00
f14218c7ad The approach for allowing authorization by user or IP introduced in r956387,
etc. causes problems because the authentication module calls
note_*_auth_failure if authentication fails. This is inappropriate if access is
later allowed because of the IP.

So, instead of calling the auth_checker hook even if authentication failed, we
introduce a new access_checker_ex hook that runs between the access_checker and
the check_user_id hooks. If an access_checker_ex functions returns OK, the
request will be allowed without authentication.

To make use of this, change mod_authz_core to walk the require blocks in the
access_checker_ex phase and deny/allow the request if the authz result does not
depend on an authenticated user. To distinguish a real AUTHZ_DENIED from an
authz provider from an authz provider needing an authenticated user, the latter
must return the new AUTHZ_DENIED_NO_USER code.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@964156 13f79535-47bb-0310-9956-ffa450edef68
2010-07-14 19:59:31 +00:00
4c8baf8db2 Add ap_process_request_after_handler to the exported list for mod_serf
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@906606 13f79535-47bb-0310-9956-ffa450edef68
2010-02-04 18:50:05 +00:00
04fd4abf90 Fix a lot of doxygen warnings. Thanks to Brad Hards for the patch.
I added a few more fixes, and there are still more that might
need a doxygen expert.

PR: 48061
Submitted by: Brad Hards
Reviewed by: poirier


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@830527 13f79535-47bb-0310-9956-ffa450edef68
2009-10-28 13:25:49 +00:00
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
cc34f73c89 * include/http_request.h: Fix warning with gcc -Wall.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@645472 13f79535-47bb-0310-9956-ffa450edef68
2008-04-07 12:09:02 +00:00
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
c8ba67fb83 Avoid calling access control hooks for internal requests with
configurations which match those of the initial request.  Revert to
the original behaviour (call access control hooks for internal requests
with URIs different from the initial request) if any access control hooks
or providers are not registered as permitting this optimization.
Introduce wrappers for access control hook and provider registration
which can accept additional mode and flag data.

The configuration walk optimizations were originally proposed a while
ago (see http://marc.info/?l=apache-httpd-dev&m=116536713506234&w=2);
they have been used since then in production systems and appear to be
stable and effective.  They permit certain combinations of modules
and clients to function efficiently, especially when a deeply recursive
series of internal requests, such as those generated by certain WebDAV
requests, are all subject to the identical authentication and authorization
directives.

The major change from the original proposal is a cleaner mechanism for
detecting modules which may expect the old behaviour.  This has been
tested successfully with Subversion's mod_authz_svn, which specifically
requires the old behaviour when performing path-based authorization based
against its own private access control configuration files.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@644525 13f79535-47bb-0310-9956-ffa450edef68
2008-04-03 21:51:07 +00:00
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
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
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
6c4c099fb4 Corrected an out-of-date comment (it's been a while since main.c has
called ap_process_request)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@307355 13f79535-47bb-0310-9956-ffa450edef68
2005-10-09 03:53:01 +00:00
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
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
438accf0f9 Minor comment fixes, no code changes:
- 'sub request' -> 'subrequest'
  - @retrn -> @return
  - ...

PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105408 13f79535-47bb-0310-9956-ffa450edef68
2004-10-11 19:27:29 +00:00
0226c056ec use more intuitive variable names
ap_sub_req_*_uri  to use new_uri
ap_sub_req_*_file to use new_file

PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@104758 13f79535-47bb-0310-9956-ffa450edef68
2004-08-20 20:58:49 +00:00
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
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
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
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
742af25096 finished that boring job:
update license to 2003.

Happy New Year! ;-))


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98573 13f79535-47bb-0310-9956-ffa450edef68
2003-02-03 17:53:28 +00:00
29b0070685 Clarify the use and sequencing of these three hooks.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96508 13f79535-47bb-0310-9956-ffa450edef68
2002-08-23 22:16:05 +00:00
8d6c820a34 Revert to the 1.39 comments about NULL for ap_sub_req_lookup() next_filter
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95848 13f79535-47bb-0310-9956-ffa450edef68
2002-06-22 19:39:45 +00:00
c959a9ace8 Note the changed meaning of the NULL next_filter argument to the
ap_sub_req_lookup() family, and fix a few oddball cases (those are,
  PATH_TRANSLATED reference issues.)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95844 13f79535-47bb-0310-9956-ffa450edef68
2002-06-22 16:32:45 +00:00
845cbfd508 Update our copyright for this year.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93918 13f79535-47bb-0310-9956-ffa450edef68
2002-03-13 20:48:07 +00:00
011c7375e9 Which PR? I can't count them all. Get QUERY_STRING and PATH_INFO
working again.  Also rounds out our fix to work around negotiated
  directories which Greg Ames fixed; this addition in request.c simply
  shortcuts all further processing.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93045 13f79535-47bb-0310-9956-ffa450edef68
2002-01-27 07:44:07 +00:00
cb8569e4f8 This patch eliminates the wasteful run-time conversion of method names from
strings to numbers in places where the methods are known at compile
time.

(Justin fixed the va_end() call to be correct.)

Submitted by:	Brian Pane <bpane@pacbell.net>
Reviewed by:	Justin Erenkrantz


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91078 13f79535-47bb-0310-9956-ffa450edef68
2001-09-19 05:52:42 +00:00
3db323656f Normalize all paths to run the same, common code for pre-request setup
from the primary request, redirects and sub-requests.

  This will significantly reduce opporunities for inconsistancy (such
  as Ian observed, and as I repaired only a month ago.)

  This promotes process_request_internal to an ap_ namespace protected
  entity in server/request.c (from it's old home in http/http_request.c)
  since this fn has no http specifics.

Reviewed (in concept): Cliff Woolley, Ian Holsman


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90832 13f79535-47bb-0310-9956-ffa450edef68
2001-08-31 01:38:06 +00:00
307ab55886 Introduce the map_to_storage hook, which allows modules to bypass
the directory_walk and file_walk for non-file requests.  TRACE
  shortcut moved to http_protocol.c as APR_HOOK_MIDDLE, and the
  directory_walk/file_walk happen as APR_HOOK_VERY_LAST in core.c.

  A seperate patch to mod_proxy is required to short circuit both the
  TRACE and directory_walk/file_walk stuff.  That patch is next.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90665 13f79535-47bb-0310-9956-ffa450edef68
2001-08-25 23:43:19 +00:00
8c678242ec Fix the macro expansion problem in the hook declaration.
Submitted by:	Ian Holsman <ianh@cnet.com>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90098 13f79535-47bb-0310-9956-ffa450edef68
2001-08-11 18:03:28 +00:00
5835764fc8 _THIS_ is why mod_dir wouldn't serve the results of mod_negotiation
with a query string


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89948 13f79535-47bb-0310-9956-ffa450edef68
2001-08-06 19:10:12 +00:00
68eb2c2c83 The real slim shady finally stood up. This patch segregates the fast
internal redirect logic back into http_request, the next patch will
  actually fix it.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89946 13f79535-47bb-0310-9956-ffa450edef68
2001-08-06 19:03:37 +00:00
0d3a73e395 Downgrade non-stopper from XXX->###
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89664 13f79535-47bb-0310-9956-ffa450edef68
2001-07-23 19:02:03 +00:00
a7a28bd8c0 Here, finally are a few cleanups of my fat fingers.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89444 13f79535-47bb-0310-9956-ffa450edef68
2001-06-27 20:57:14 +00:00
8ba66cccaf Move duplicated rnew cloning from apr_ap_sub_req_lookup_*() functions,
and add an ap_sub_req_lookup_dirent() to create a subrequest from the
  results of an apr_dir_read() for mod_negotiation and mod_autoindex.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89437 13f79535-47bb-0310-9956-ffa450edef68
2001-06-27 20:09:24 +00:00
44238d2266 change create_request hook to RUN_ALL/return int so handlers can throw errors
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88576 13f79535-47bb-0310-9956-ffa450edef68
2001-03-25 17:38:18 +00:00
895b7b26ac Add a hook, create_request. This hook allows modules to modify
a request while it is being created.  This hook is called for all
request_rec's, main request, sub request, and internal redirect.
When this hook is called, the the r->main, r->prev, r->next
pointers have been set, so modules can determine what kind of
request this is.

Currently, this is only used by the core module, but protocol modules
are going to need to have the ability to affect the request while it is
being read.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88532 13f79535-47bb-0310-9956-ffa450edef68
2001-03-18 02:33:23 +00:00
af98abf4e7 Check in not-quite-working hooks groupings.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88513 13f79535-47bb-0310-9956-ffa450edef68
2001-03-13 22:20:55 +00:00
54ed3070d5 Another chunk of code from http to core. This should continue to build
on all platforms.  The next job is to shuffle functions back and forth
so that the server builds without mod_http.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88453 13f79535-47bb-0310-9956-ffa450edef68
2001-03-05 04:43:56 +00:00
381f88d56a Update copyright to 2001
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88184 13f79535-47bb-0310-9956-ffa450edef68
2001-02-16 04:26:53 +00:00
bcb1a9309e fix minor prototype inconsistencies noticed with C::Scan
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87970 13f79535-47bb-0310-9956-ffa450edef68
2001-02-04 03:00:15 +00:00
711044bb5b More doc improvements.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87912 13f79535-47bb-0310-9956-ffa450edef68
2001-01-29 22:29:23 +00:00
59bbd68bec The big change. This is part 3 of the apr-util symbols rename, please
see the first commit of srclib/apr-util/include (cvs apr-util/include)
  for the quick glance at symbols changed.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87731 13f79535-47bb-0310-9956-ffa450edef68
2001-01-19 07:04:36 +00:00
02f60b7ea4 Allow modules to specify the first module for a sub-request. This allows
modules to not have to muck with the output_filter after it creates the
sub-request.  Without this change, modules that create a sub-request have
to manually edit the output_filters, and therefore skip the sub-request
output_filter.  If they skip the sub-request output_filter, then we end
up sending multiple EOS buckets to the core_output_filter.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87065 13f79535-47bb-0310-9956-ffa450edef68
2000-11-22 19:38:07 +00:00
4743e5fa7a Fix a broken thing
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86645 13f79535-47bb-0310-9956-ffa450edef68
2000-10-18 17:38:30 +00:00