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

3148 Commits

Author SHA1 Message Date
Philip M. Gollucci
1ddd51491f relocate so that we don't need to rename apreq_ to ap_
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/apreq-integration@725386 13f79535-47bb-0310-9956-ffa450edef68
2008-12-10 19:13:23 +00:00
Philip M. Gollucci
94fcb7f5b0 copy the library over to the httpd server core
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/apreq-integration@725379 13f79535-47bb-0310-9956-ffa450edef68
2008-12-10 18:52:48 +00:00
Ruediger Pluem
c7d3363295 * Remove unused variable
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@724332 13f79535-47bb-0310-9956-ffa450edef68
2008-12-08 12:54:51 +00:00
Paul Querna
7ff39c3567 Remove commented out block that wouldn't even work in this context.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@724084 13f79535-47bb-0310-9956-ffa450edef68
2008-12-07 05:51:23 +00:00
Paul Querna
2b494140a5 Don't pass in a pool to to argstr_to_table, and duplicate r->args before sending it in.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@724080 13f79535-47bb-0310-9956-ffa450edef68
2008-12-07 05:45:31 +00:00
Paul Querna
03eb917952 New API, ap_body_to_table, a very ineffeicent and bad hack to remove an apreq dependency.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/wombat-integration@723652 13f79535-47bb-0310-9956-ffa450edef68
2008-12-05 08:36:26 +00:00
Paul Querna
ba87dcea6a Add new api, ap_args_to_table, to parse a request's arguments into a table.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/wombat-integration@723627 13f79535-47bb-0310-9956-ffa450edef68
2008-12-05 07:15:22 +00:00
Paul Querna
f47b6f394e Import the core parts of the DTrace patch. This is a modified and updated
version of what was submited by Theo before:
 <http://mail-archives.apache.org/mod_mbox/httpd-dev/200805.mbox/%3C6AFBCFE8-4CCA-4A02-8A43-F9170689695D@omniti.com%3E>

Note, this does not hook it up into the build system at this time, because
the original patch was a little too creative there.

Submitted By: Theo Schlossnagle <jesus omniti.com>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@723565 13f79535-47bb-0310-9956-ffa450edef68
2008-12-05 03:34:52 +00:00
Ruediger Pluem
1848a50775 * The API Cleanup in r722399 missed some locations.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@722408 13f79535-47bb-0310-9956-ffa450edef68
2008-12-02 09:09:00 +00:00
Paul Querna
a73acf02f6 API Cleanup in preperation for 2.4.x, make sure all exported functions or variables contain an ap_ prefix.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@722399 13f79535-47bb-0310-9956-ffa450edef68
2008-12-02 08:13:36 +00:00
Eric Covener
46afcfe011 allow ap_invoke_handler() to pass-through AP_FILTER_ERROR as if it were
a reserved status code (OK/DECLINED/SUSPENDED). Prevents ap_die() from
seeing a 500 error when the http header filter has already taken
care of the proper error response



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@721679 13f79535-47bb-0310-9956-ffa450edef68
2008-11-29 13:09:36 +00:00
Paul Querna
15829bbe5d Fix MaxRequestsPerChild on the Event MPM. It hasn't worked for 4 years.
* server/mpm/experimental/event/event.c
    (process_socket): Be consistent about our return value, returning 0
      means this connection is done, and that we can decrement requests_this_child.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@719357 13f79535-47bb-0310-9956-ffa450edef68
2008-11-20 20:27:07 +00:00
Nick Kew
368d9bb335 Further unixd hacks to remove duplication between old-unixd and mod_unixd,
and get it working with old MPMS[1] + mod_unixd.  It's still an uneasy
split, as some modules (mod_cgid, suexec)[2] also use unixd.
More thinking+hacking due.

[1] Should be prefork/worker/event, but only worker is tested.
[2] cgid is OK, suexec is untested.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@711146 13f79535-47bb-0310-9956-ffa450edef68
2008-11-04 00:44:56 +00:00
Paul Querna
beacc171b7 Make sure we clear out previous things we were listening for.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@710111 13f79535-47bb-0310-9956-ffa450edef68
2008-11-03 17:41:00 +00:00
Nick Kew
6a61e11758 Move security check to post_config, ćos pre-config hooks don´t
run in expected order.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@710108 13f79535-47bb-0310-9956-ffa450edef68
2008-11-03 17:24:56 +00:00
Nick Kew
a1252f96e3 Wrap the global count of privileges handlers operating. Silence grumblers.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@710037 13f79535-47bb-0310-9956-ffa450edef68
2008-11-03 11:37:03 +00:00
Nick Kew
72119d92f5 Switch all unix MPMs to use drop_privileges hook (mod_unixd) for startup
and add a flag to prevent running without any module taking responsibility
for managing system privileges!


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@709993 13f79535-47bb-0310-9956-ffa450edef68
2008-11-03 00:46:54 +00:00
Paul Querna
7283c2d9e5 Convert events to have an associated pool.
* server/mpm/simple/simple_types.h
    (simple_timer_t): Add Pool and a pointer to the associated simple core.
    (simple_core_t): Remove dead timer ring, no recycling of timer events for now.

* server/mpm/simple/simple_event.h: Update register_timer signature with pool.

* server/mpm/simple/simple_event.c
    (simple_register_timer): Allocate the event structure out of the pool,
        and when this pool is destroyed, unregister the timer.
    (simple_timer_run): New util function for running a timer and cleaning up 
        the pool callbacks.

* server/mpm/simple/simple_core.c
    (simple_core_init): Remvoe dead timer ring

* server/mpm/simple/simple_run.c
    (simple_main_setup_timers): Pass in pool to register call.
    (simple_timer_invoke): Use new simple_timer_run function.
    (simple_child_loop): Remove dead timer ring.

* server/mpm/simple/simple_io.c
    (simple_io_process): Pass in pool when registering timers.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@709657 13f79535-47bb-0310-9956-ffa450edef68
2008-11-01 07:13:29 +00:00
Paul Querna
2f01a7c687 Reset the timers when in the child -- this prevents a fork bomb, as each child would spawn N more children of its own, as the scheduled timer would go off in the child and the parent.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@709655 13f79535-47bb-0310-9956-ffa450edef68
2008-11-01 06:14:12 +00:00
Paul Querna
9a702bf031 Remove extra log line with how many threads are being spawned.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@709654 13f79535-47bb-0310-9956-ffa450edef68
2008-11-01 06:03:39 +00:00
Paul Querna
eac12b8b18 Move creation of the pollcb object to after we fork(), since kqueues don't persist across fork(). (huh, didn't know that before)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@709653 13f79535-47bb-0310-9956-ffa450edef68
2008-11-01 06:02:01 +00:00
Chris Darroch
89e17a3d24 Allow <Limit> and <LimitExcept> directives to nest, and
constrain their use to conform with that of other access control
and authorization directives.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@709551 13f79535-47bb-0310-9956-ffa450edef68
2008-10-31 20:10:07 +00:00
Jim Jagielski
76746c09e9 Make a valid prototype
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@709229 13f79535-47bb-0310-9956-ffa450edef68
2008-10-30 19:29:18 +00:00
Paul Querna
9c0569735d Basic support for spawning children porcesses via fork() and killing them with kill().
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@709136 13f79535-47bb-0310-9956-ffa450edef68
2008-10-30 10:46:58 +00:00
Paul Querna
5ac9eeb4bb Remove completed todo items.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@709079 13f79535-47bb-0310-9956-ffa450edef68
2008-10-30 01:52:35 +00:00
Paul Querna
a67dbf6233 reindent according to our coding style: <http://httpd.apache.org/dev/styleguide.html>
for i in `ls *.h *.c`; do indent -i4 -npsl -di0 -br -nce -d0 -cli0 -npcs -nfc1 -nut ${i}; done


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@709078 13f79535-47bb-0310-9956-ffa450edef68
2008-10-30 01:50:09 +00:00
Paul Querna
0817768963 Create a new drop_privileges hook for the Simple MPM.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@709062 13f79535-47bb-0310-9956-ffa450edef68
2008-10-30 00:54:02 +00:00
Paul Querna
2d975344e4 Remove SimpleUser configuration command, this will all be handled inside mod_unixd.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@709060 13f79535-47bb-0310-9956-ffa450edef68
2008-10-30 00:39:19 +00:00
Nick Kew
dd35c784d6 Introduce modules/system, and mod_unixd.c
mod_unixd.c is only os/unix/unixd.c, turned into a module.
(or more accurately, an ugly hack).  Work in progress, and the
old unixd will have to go once the module build stuff is in place.

This re-introduces some of the unixd stuff (set user, group and chroot)
to mpm_simple, and should work equally well with existing MPMs.
It also paves the way for alternative privilege management schemes,
which can be implemented in alternative modules: this´ll be
necessary to run mpm_simple on non-unix-family platforms, and
of interest for alternative Unix implementations.  By relegating
everything to a child_init hook, we can mix-and-match, though
weĺl need to add a regime that prevents just going right ahead
with nothing and running as root.

Round tuits permitting, we should be able to simplify unixd.h too,
and look towards eliminating it.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@708935 13f79535-47bb-0310-9956-ffa450edef68
2008-10-29 16:41:10 +00:00
Paul Querna
485ed11102 * server/core.c: Fix implicit declaration of function 'unixd_set_rlimit' by
including unixd.h.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@708814 13f79535-47bb-0310-9956-ffa450edef68
2008-10-29 08:00:50 +00:00
Paul Querna
5f24c39a09 Improve ability to compile on C90 Compilers.
* Move all variable declartions to the top of their blocks.
* Remove traiing comma on enum
* Only use C90 style comments.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@708813 13f79535-47bb-0310-9956-ffa450edef68
2008-10-29 07:56:19 +00:00
Paul Querna
e6583a6303 * server/mpm/simple/simple_io.c: s/simple_io_timeut_cb/simple_io_timeout_cb/g
Noticed by: Ruediger Pluem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@708707 13f79535-47bb-0310-9956-ffa450edef68
2008-10-28 22:43:04 +00:00
Paul Querna
07c03d4ff2 * simple_io.c line 111 and 145 cause a build falure with --enable-maintainer-mode .
* simple_children.c should include simple_children.h.
* simple_io_timeot_cb should be static.

Noticed by: Takashi Sato


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@708599 13f79535-47bb-0310-9956-ffa450edef68
2008-10-28 16:06:25 +00:00
Paul Querna
7539f875d5 * server/mpm/simple/simple_{event,run}.c: Turn off Ring Macro debugging.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@708463 13f79535-47bb-0310-9956-ffa450edef68
2008-10-28 07:01:30 +00:00
Paul Querna
6388ea0599 Add a work in progress, a completely new, "Simple MPM".
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@708462 13f79535-47bb-0310-9956-ffa450edef68
2008-10-28 07:00:15 +00:00
Ruediger Pluem
80ddb8dadc * Do more greedy reads in the core input filter to get more closer to the
number of bytes requested.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@708144 13f79535-47bb-0310-9956-ffa450edef68
2008-10-27 11:39:04 +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
Ruediger Pluem
4f4fec46e7 * Recheck again if idle workers are still available when we are signaled that
they are. This is needed since it can happen that we are signaled by a
  worker thread that went idle but received a context switch before it could
  tell us. If it does signal us later once it is on CPU again there might be
  no idle worker left. See
  https://issues.apache.org/bugzilla/show_bug.cgi?id=45605#c4

PR: 45605
Submitted by: Denis Ustimenko <denusk gmail.com>
Reviewed by: rpluem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@702867 13f79535-47bb-0310-9956-ffa450edef68
2008-10-08 13:32:07 +00:00
William A. Rowe Jr
4e904d4f40 Reimplement ThreadStackSize to behave as on unix for any
Windows 2003/2008 (XP/Vista) servers.  Virtual allocations
will only consume pages once referenced, while the page
alignment will vary by ThreadStackSize setting so that the
maximum number of threads and minimum stack VM profile will
be wasted.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@699481 13f79535-47bb-0310-9956-ffa450edef68
2008-09-26 20:15:10 +00:00
William A. Rowe Jr
a32176854b The last two of several helper threads which do not need a default
1GB stack (but where on earth does 1000 come from?  nonsense.)

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@699480 13f79535-47bb-0310-9956-ffa450edef68
2008-09-26 20:13:29 +00:00
William A. Rowe Jr
1a0ec56c6b The next of several helper threads which do not need a default 1GB stack
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@699478 13f79535-47bb-0310-9956-ffa450edef68
2008-09-26 20:11:27 +00:00
William A. Rowe Jr
f1370662b3 The first of several helper threads which do not need a default 1GB stack
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@699477 13f79535-47bb-0310-9956-ffa450edef68
2008-09-26 20:10:41 +00:00
William A. Rowe Jr
1a8fba5d31 Track the internal stack_res_flag for properly constraining
win32 stacksize on windows 2003 (xp) and 2008 (vista).

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@699476 13f79535-47bb-0310-9956-ffa450edef68
2008-09-26 20:08:15 +00:00
William A. Rowe Jr
4e0b5e2afe CoredumpDir useless on win32; implementing toolhelp.dll is nontrivial
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@699474 13f79535-47bb-0310-9956-ffa450edef68
2008-09-26 20:06:09 +00:00
Paul Querna
1457f7207a Add dummy ap_mpm_register_timed_callback for other MPMs besides Event.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@697425 13f79535-47bb-0310-9956-ffa450edef68
2008-09-20 22:04:03 +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
4ed2378c5e mod_session_cookie, mod_session_dbd: Make sure cookies are set both
within the output headers and error output headers, so that the
session is maintained across redirects.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@690501 13f79535-47bb-0310-9956-ffa450edef68
2008-08-30 13:37:52 +00:00
Graham Leggett
0ec83e8b1b mod_session_cookie: Make sure that cookie attributes are correctly
included in the blank cookie when cookies are removed. This fixes an
inability to log out when using mod_auth_form.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@690400 13f79535-47bb-0310-9956-ffa450edef68
2008-08-29 21:49:27 +00:00
Sander Temme
3233157214 The error logging core only logs at very high level if it has no
server_rec from which to read the appropriate LogLevel.  Ensure that 
everything gets logged when -DDEBUG is passed to the compiler. 

This makes the server very verbose, on the command line before stderr is 
redirected and in the error log afterwards.  This is appropriate when 
debugging, but not under normal circumstances. 



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@686271 13f79535-47bb-0310-9956-ffa450edef68
2008-08-15 16:11:46 +00:00
Joe Orton
166a985de7 * server/util_cookies.c (ap_cookie_write2): Add missing sentinel in
apr_pstrcat call.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@683286 13f79535-47bb-0310-9956-ffa450edef68
2008-08-06 14:52:37 +00:00