summaryrefslogtreecommitdiffstats
path: root/include/ap_mpm.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* mpm_event,mod_http2,mod_status: Follow up to r1918257: CONN_STATE_ASYNC_WAITIO.Yann Ylavic2024-06-211-2/+2
| | | | | | | | | | | | | | | | Per discussion on PR #449, have a separate state for returning the connection to the MPM to wait for an IO (namely CONN_STATE_ASYNC_WAITIO), rather than (ab)using CONN_STATE_PROCESSING. This removes the need for AGAIN added in r1918257 (for now), and AP_MPMQ_CAN_AGAIN is renamed to AP_MPMQ_CAN_WAITIO. This is also the state that mod_status accounts for, so rename ->processing to ->wait_io in process_score (shows as "wait-io" in mod_status and mod_lua). git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1918482 13f79535-47bb-0310-9956-ffa450edef68
* mpm_event,mod_http2: Keep compatibility with CONN_STATE_PROCESSING + OKYann Ylavic2024-06-111-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before r1918022, returning OK with CONN_STATE_PROCESSING to mpm_event was handled like/by CONN_STATE_LINGER "to not break old or third-party modules which might return OK w/o touching the state and expect lingering close, like with worker or prefork MPMs". So we need a new return code to be allowed to apply the new POLLIN/POLLOUT behaviour for CONN_STATE_PROCESSING, thus revive AGAIN as introduced by Graham some times ago for a nonblocking WIP (moved to a branch/PR since then). MPM event will advertise its ability to handle CONN_STATE_PROCESSING + AGAIN with AP_MPMQ_CAN_AGAIN, and mod_http2 can use that to know how to return to the MPM as expected. When !AP_MPMQ_CAN_AGAIN modules/mod_http2 can still use CONN_STATE_WRITE_COMPLETION + CONN_SENSE_WANT_READ + c->clogging_input_filters which will work in mpm_even-2.4.x still. * include/ap_mmn.h: Bump MMN minor for AP_MPMQ_CAN_AGAIN and AGAIN. * include/ap_mpm.h: Define AP_MPMQ_CAN_AGAIN. * include/httpd.h: Define AGAIN. * modules/http2/h2.h: No need for H2_USE_STATE_PROCESSING anymore with AP_MPMQ_CAN_AGAIN. * modules/http2/h2_c1.c: For !keepalive case return to the MPM using CONN_STATE_PROCESSING + AGAIN or CONN_STATE_WRITE_COMPLETION + c->clogging_input_filters depending on AP_MPMQ_CAN_AGAIN only. * modules/http2/h2_session.c: Can return to the MPM for h2_send_flow_blocked() provided it's async only. * server/mpm/event/event.c: Rework process_socket()'s CONN_STATE_PROCESSING to handle AGAIN and preserve compatibility. Have a lingering_close label to goto there faster when process_lingering_close() is to be called. Improve relevant comments. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1918257 13f79535-47bb-0310-9956-ffa450edef68
* *) core/mod_ssl/mpm_event: reverting changes to nonblocing SSL handshakesStefan Eissing2022-02-041-2/+0
| | | | | | | | | | to stabilize CI tests again. Previous revision of trunk has been copied to branches/trunk-ssl-handshake-unblocking to make those into a PR where changes can be discussed and tested separately. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897760 13f79535-47bb-0310-9956-ffa450edef68
* event: Add AP_MPM_CAN_AGAIN and AGAIN to signal to the MPM thatGraham Leggett2022-01-241-0/+2
| | | | | | | non blocking behaviour is requested. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897423 13f79535-47bb-0310-9956-ffa450edef68
* Follow up to r1879449: yet better MPM poll callback API.Yann Ylavic2020-07-021-2/+2
| | | | | | | | | Let pass a const pfds to the MPM, for it to make a copy on the given pool as needed. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1879451 13f79535-47bb-0310-9956-ffa450edef68
* mpm_common: add pool argument to mpm_register_poll_callback[_timeout] hooks.Yann Ylavic2020-07-021-3/+13
| | | | | | | | | | | This is cleaner API than using pfds->pool implicitely. MAJOR bump but reusing the existing hooks (with an API/ABI breakage) because it's trunk material only. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1879449 13f79535-47bb-0310-9956-ffa450edef68
* mpm_common: remove ap_mpm_unregister_poll_callback().Yann Ylavic2020-07-021-10/+0
| | | | | | | | | | | It's now called automatically by mpm_event and anyway can't be called safely outside the MPM code without racing. MAJOR bump. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1879422 13f79535-47bb-0310-9956-ffa450edef68
* Fix some doxygen warning.Christophe Jaillet2016-05-301-4/+1
| | | | | | Make the use of 'pfds' and 'pds' consistent git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1746189 13f79535-47bb-0310-9956-ffa450edef68
* reverting the reverting of r1735174, r1735176 was the culpritStefan Eissing2016-03-161-28/+31
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1735227 13f79535-47bb-0310-9956-ffa450edef68
* reverting r1735174 as http/1.1 just terminated before responseStefan Eissing2016-03-161-31/+28
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1735216 13f79535-47bb-0310-9956-ffa450edef68
* mpm: Generalise the ap_mpm_register_socket functions to accept pipes or sockets.Graham Leggett2016-03-151-28/+31
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1735174 13f79535-47bb-0310-9956-ffa450edef68
* Revert r1601943, r1602058, r1605307 (socket callback returning pollfds)Takashi Sato2014-06-271-3/+2
| | | | | | | | | | Revert r1605369 (wstunnel refactoring) per discassion on dev@httpd.a.o thread Message-ID: <CALK=YjN9HfThP_k_rF9iJPcUhcQk9sNOaDPxZNG+HcJNWS4ZAQ@mail.gmail.com> git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1605946 13f79535-47bb-0310-9956-ffa450edef68
* Follow up r1601943:Takashi Sato2014-06-121-1/+1
| | | | | | | | | Fix typo. No functional change. Pointed out by mrumph git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1602058 13f79535-47bb-0310-9956-ffa450edef68
* Socket event callback now takes pollfd.Takashi Sato2014-06-111-2/+3
| | | | | | | | User (e.g. mod_proxy_wstunnel) can know which socket is ready. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1601943 13f79535-47bb-0310-9956-ffa450edef68
* PR56333: Add an API to resume a connection that a handler has previously ↵Eric Covener2014-05-111-0/+4
| | | | | | | | | | suspended. Submitted by: Artem <artemciy gmail.com>, Edward Lu <Chaosed0 gmail.com> Committed by: covener git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1593860 13f79535-47bb-0310-9956-ffa450edef68
* Extend the socket callbacks in event to allow a timeout on the I/O callback. Eric Covener2014-05-111-1/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | When a socket callback has a timeout, an associated timer event is used to remove the sockets from the pollset and call a timeout function. * This includes a noteworthy change to the main event loop. Previously, we would call epoll, then process the timer events, then iterate through the poll results. After this patch, the timer events are processed before the poll() a _non-queued_ action can change the pollset conents (a users timed callback function conversely could easily sit in a queue while the main thread continues down into epoll) * timer events can now have sockets associated with them, those sockets are removed from the pollset when the timer event fires w/o a queue to the worker. * timer events now have a canceled flag that can be toggled without locking the timer list. * Drop the severity of some wstunnel messages from DEBUG to TRACE1 * Lift the restriction on using asynchronous websockets connections but having an idle timeout git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1593857 13f79535-47bb-0310-9956-ffa450edef68
* doxygen improvementsJeff Trawick2014-01-221-28/+73
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1560482 13f79535-47bb-0310-9956-ffa450edef68
* fix Doxygen warnings/commentsJeff Trawick2013-08-131-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1513461 13f79535-47bb-0310-9956-ffa450edef68
* Fold in Eric Covener's socket callbackJim Jagielski2013-06-171-0/+23
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1493741 13f79535-47bb-0310-9956-ffa450edef68
* Fix another compiler warningStefan Fritsch2012-02-251-1/+1
| | | | | | | Submitted by: Daniel Shahaf <danielsh elego de> git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1293535 13f79535-47bb-0310-9956-ffa450edef68
* More cleanup: Expand tabs and some more indentation fixesStefan Fritsch2011-09-231-3/+3
| | | | | | | No functional change git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1174929 13f79535-47bb-0310-9956-ffa450edef68
* Cleanup effort in prep for GA push:Jim Jagielski2011-09-231-8/+8
| | | | | | | | Trim trailing whitespace... no func change git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1174748 13f79535-47bb-0310-9956-ffa450edef68
* Add child_status hook for tracking creation/termination of MPM childJeff Trawick2011-04-251-1/+39
| | | | | | | | | | | | | | processes. Add end_generation hook for notification when the last MPM child of a generation exits. end_generation is implemented completely by core using the child_status hook run by the MPM. simple and mpmt_os2 MPMs don't currently run the child_status hook, so neither hook is invoked with those MPMs. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1096609 13f79535-47bb-0310-9956-ffa450edef68
* Improve the comments for AP_MPMQ_NOT_SUPPORTED/AP_MPMQ_STATIC/AP_MPMQ_DYNAMICStefan Fritsch2010-06-081-8/+8
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@952791 13f79535-47bb-0310-9956-ffa450edef68
* Fix a lot of doxygen warnings. Thanks to Brad Hards for the patch.Daniel Earl Poirier2009-10-281-1/+1
| | | | | | | | | | | | 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
* main() can use ap_run_mpm() directly, so axe the old ap_mpm_run() functionJeff Trawick2009-04-051-6/+5
| | | | | | | change the mpm hooks to return OK/DONE instead of 0/1 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@762127 13f79535-47bb-0310-9956-ffa450edef68
* mpm-query hook: distinguish between DECLINED and APR_ENOTIMPL so thatJeff Trawick2009-04-011-2/+6
| | | | | | | | | . ap_mpm_query() can return APR_EGENERAL if called too early (for debugging a module) . some hypothetical module which implements the mpm-query hook can bypass the MPM with APR_ENOTIMPL git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@760864 13f79535-47bb-0310-9956-ffa450edef68
* If serf is available, compile in driving the serf event loop from inside thePaul Querna2009-03-281-0/+1
| | | | | | | | | Event MPM. Add a new MPM Query to determine if an MPM supports this. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@759413 13f79535-47bb-0310-9956-ffa450edef68
* fix typo in commentJeff Trawick2009-03-271-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@759113 13f79535-47bb-0310-9956-ffa450edef68
* Introduce a new set of APIs to allow MPMs to be proper modules insteadJeff Trawick2009-03-241-7/+9
| | | | | | | | | | | | | | of integral parts which share global variables, functions, and macros with the rest of httpd. Converted now: prefork, worker, event, simple, WinNT* *WinNT hasn't been built or tested, and relies on a hack to include the WinNT mpm.h to disable Unixy MPM support routines in mpm_common.c git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@757853 13f79535-47bb-0310-9956-ffa450edef68
* Introduce Suspendable Requests to the Event MPM.Paul Querna2008-09-201-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Remove ap_graceful_stop_signalled from all MPMs.Paul Querna2008-04-071-8/+0
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@645437 13f79535-47bb-0310-9956-ffa450edef68
* Use correct Doxygen keywords for functions and variables. TODO: figure out ↵Sander Temme2007-07-041-3/+3
| | | | | | whether those keywords are actually necessary. HTML-ify some documentation comments for benefit of Doxygen. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@553013 13f79535-47bb-0310-9956-ffa450edef68
* * Add extern "C" linkage to several headers to make it easier to useRuediger Pluem2007-05-041-0/+8
| | | | | | | | | | | them in C++ code. PR: 42286 Submitted by: Davi Arnaut <davi haxent.com.br> Reviewed by: rpluem git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@535169 13f79535-47bb-0310-9956-ffa450edef68
* update license header textRoy T. Fielding2006-07-111-6/+6
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@420983 13f79535-47bb-0310-9956-ffa450edef68
* Update the copyright year in all .c, .h and .xml filesColm MacCarthaigh2006-04-191-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@395228 13f79535-47bb-0310-9956-ffa450edef68
* Doxygen fixup / cleanupIan Holsman2005-08-291-4/+10
| | | | | | | | | 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
* Update copyright year to 2005 and standardize on current copyright owner line.Justin Erenkrantz2005-02-041-1/+2
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@151408 13f79535-47bb-0310-9956-ffa450edef68
* The Event MPM.Paul Querna2004-11-201-0/+1
| | | | | | | | | | | | | | | | | | | | 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
* fix name of The Apache Software FoundationAndré Malo2004-02-091-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102619 13f79535-47bb-0310-9956-ffa450edef68
* fix copyright dates according to the first check inAndré Malo2004-02-071-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102548 13f79535-47bb-0310-9956-ffa450edef68
* apply Apache License, Version 2.0André Malo2004-02-061-49/+10
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102525 13f79535-47bb-0310-9956-ffa450edef68
* outch. Fix include guard to match the right name.André Malo2004-02-041-2/+2
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102504 13f79535-47bb-0310-9956-ffa450edef68
* update license to 2004.André Malo2004-01-011-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102135 13f79535-47bb-0310-9956-ffa450edef68
* add new MPM query -- AP_MPMQ_MPM_STATE -- to find out what the MPMJeff Trawick2003-12-101-1/+6
| | | | | | | | | is doing work-in-progress; not so useful until other MPMs support it git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102019 13f79535-47bb-0310-9956-ffa450edef68
* Add fatal exception hook for use by debug modules. The hook is onlyJeff Trawick2003-11-261-0/+9
| | | | | | | | | available if the --enable-exception-hook configure parm is used. Sample users at http://httpd.apache.org/~trawick/exception_hook.html git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101899 13f79535-47bb-0310-9956-ffa450edef68
* finished that boring job:André Malo2003-02-031-1/+1
| | | | | | | | | 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
* Update our copyright for this year.Roy T. Fielding2002-03-131-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93918 13f79535-47bb-0310-9956-ffa450edef68
* carry over from 1.3: disable profiling in the parent process #ifdef GPROFDoug MacEachern2001-11-291-0/+14
| | | | | | | | | | PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92230 13f79535-47bb-0310-9956-ffa450edef68
* Allow modules that add sockets to the ap_listeners list toRyan Bloom2001-11-131-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | define the function that should be used to accept on that socket. Each MPM can define their own function to use for the accept function with the MPM_ACCEPT_FUNC macro. This also abstracts out all of the Unix accept error handling logic, which has become out of synch across Unix MPMs. The code flow is much easier now for different transports: 1) During pre-config, post-config or while parsing the config file, add a socket to the ap_listeners list, making sure to define an accept function at the same time. 2) MPMs find the correct listener, and call the accept function that was defined in step 1. 3) That accept function returns a void pointer, which is passed to the create_connection hook. 4) create_connection adds the correct low-level filters. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91916 13f79535-47bb-0310-9956-ffa450edef68