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

992 Commits

Author SHA1 Message Date
Jim Jagielski
6777364613 Hopefully the final fix for the subreq/filter issue. The
prob was that we at this point could still have some
stale and incorrect refs when we adjusted the f-stack.
So move the update earlier so when we adjust, we're
affecting r. RŸdiger and Jim pretty much
simultaneously :)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@725077 13f79535-47bb-0310-9956-ffa450edef68
2008-12-10 13:01:31 +00:00
Jim Jagielski
a36484e4e0 reset chain if we need to...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@724805 13f79535-47bb-0310-9956-ffa450edef68
2008-12-09 18:19:20 +00:00
Ruediger Pluem
206fa0e2f4 * Correctly remove the SUBREQ_CORE filter from the filter chain if we do an
internal fast redirect and if the new redirected request is NO subrequest.
  This fixes at least one of the possible subtle issues mentioned in the
  comment to r620133.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@724515 13f79535-47bb-0310-9956-ffa450edef68
2008-12-08 22:18:27 +00:00
Paul Querna
e70a4ba68c Remove X-Pad work around.
Submitted by: Takashi Sato <takashi lans-tv.com>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@723585 13f79535-47bb-0310-9956-ffa450edef68
2008-12-05 05:10:13 +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
cd505682e9 * Avoid sending no answer at all if a custom error page causes an
AP_FILTER_ERROR.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@722213 13f79535-47bb-0310-9956-ffa450edef68
2008-12-01 20:27:27 +00:00
Eric Covener
5d9555b238 To be safe, consume the entire brigade after processing an error bucket in
the HTTP output filter.

Submitted by: Rudeiger Pluem
Reviewed by: niq, covener



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@722081 13f79535-47bb-0310-9956-ffa450edef68
2008-12-01 14:31:51 +00:00
Jim Jagielski
51df5d37cb Make %k work as it should. No regression noted in perl
test framework.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@720250 13f79535-47bb-0310-9956-ffa450edef68
2008-11-24 18:33:09 +00:00
Paul Querna
92e9540e3b * modules/http/http_request.c
(ap_process_async_request): Fix warning: 'return' with a value, in function 
      returning void


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@708821 13f79535-47bb-0310-9956-ffa450edef68
2008-10-29 08:18:45 +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
Ruediger Pluem
a927ddd766 * Fix compiler warning (missing sentinel in function call).
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@693224 13f79535-47bb-0310-9956-ffa450edef68
2008-09-08 19:50:40 +00:00
Nick Kew
0e3d53aeae mod_mime: don't adjust case in filename components we don't use
PR 43250, patch by Basant Kumar Kukreja


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@693141 13f79535-47bb-0310-9956-ffa450edef68
2008-09-08 15:52:59 +00:00
Nick Kew
bdb2ae4326 Relax checks on HTTP Response status line from a backend.
PR#44995 - Rainer Jung


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@693108 13f79535-47bb-0310-9956-ffa450edef68
2008-09-08 14:20:11 +00:00
William A. Rowe Jr
bbc545055b Consumed by server/*.c, belongs in include/
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@664235 13f79535-47bb-0310-9956-ffa450edef68
2008-06-07 01:39:25 +00:00
Ruediger Pluem
2948128ebb * mod_proxy_http.c
Ensure that the EOC bucket is inserted BEFORE an EOS bucket in bb as
   some resource filters like mod_deflate pass everything up to the EOS
   down the chain immediately and sent the remainder of the brigade later
   (or even never). But in this case the ap_http_header_filter does not
   get out of our way soon enough.

   http_filters.c
   Remove all data buckets that are in a brigade after an EOC bucket
   was seen, as an EOC bucket tells us that no (further) resource
   and protocol data should go out to the client. OTOH meta buckets
   are still welcome as they might trigger needed actions down in
   the chain (e.g. in network filters like SSL).
   Remark 1: It is needed to dump ALL data buckets in the brigade
             since an filter in between might have inserted data
             buckets BEFORE the EOC bucket sent by the original
             sender and we do NOT want this data to be sent.
   Remark 2: Dumping all data buckets here does not necessarily mean
             that no further data is send to the client as:
             1. Network filters like SSL can still be triggered via
                meta buckets to talk with the client e.g. for a
                clean shutdown.
             2. There could be still data that was buffered before
                down in the chain that gets flushed by a FLUSH or an
                EOS bucket.

PR: 37770


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@660726 13f79535-47bb-0310-9956-ffa450edef68
2008-05-27 21:40:48 +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
Ruediger Pluem
58d2be7591 * Only send 100-continue if the status code so far indicates success.
PR: 43711


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@657933 13f79535-47bb-0310-9956-ffa450edef68
2008-05-19 19:30:15 +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
Graham Leggett
d5030b2190 Add a function to the http filters that is able to parse an HTML
form request with the type of application/x-www-form-urlencoded.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@646281 13f79535-47bb-0310-9956-ffa450edef68
2008-04-09 11:39:58 +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
Ruediger Pluem
389a94500d * In the case that we fail to read the response line from the backend and if
we are a reverse proxy request shutdown the connection WITHOUT ANY response
  to trigger a retry by the client if allowed (as for idempotent requests).
  BUT currently we should not do this if the request is the first request on
  a keepalive connection as browsers like seamonkey only display an empty page
  in this case and do not do a retry.

Related to PR 37770



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@645813 13f79535-47bb-0310-9956-ffa450edef68
2008-04-08 09:49:13 +00:00
Joe Orton
71da0a5106 * modules/http/http_protocol.c (is_mpm_running): Fix warning with
gcc -Wall.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@645497 13f79535-47bb-0310-9956-ffa450edef68
2008-04-07 13:14:37 +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
Jim Jagielski
312d0bf2e1 close PR 44381
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@644391 13f79535-47bb-0310-9956-ffa450edef68
2008-04-03 16:21:20 +00:00
Nick Kew
481bb01b27 http_filters: Don't send 100-continue when 4xx is due
PR 43711
Reported & tested by Ragini Bisraya
Patch by Chetan Reddy
Reviewed: niq


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@628644 13f79535-47bb-0310-9956-ffa450edef68
2008-02-18 08:35:44 +00:00
Nick Kew
3609dae902 Don't add bogus duplicate Content-Language header entries.
PR 11035


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@611475 13f79535-47bb-0310-9956-ffa450edef68
2008-01-12 20:33:57 +00:00
Jim Jagielski
3e141d35ef belt and suspenders
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@610451 13f79535-47bb-0310-9956-ffa450edef68
2008-01-09 16:51:49 +00:00
Nick Kew
9c07455cd7 http_filters: make sure we get last byte of actual data in edge-case
of an empty data bucket in get_remaining_chunk_line.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@610240 13f79535-47bb-0310-9956-ffa450edef68
2008-01-09 00:24:50 +00:00
Ruediger Pluem
c56e381967 * Saveguard ourselves against underflows
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@610111 13f79535-47bb-0310-9956-ffa450edef68
2008-01-08 19:50:01 +00:00
Ruediger Pluem
290cab6745 * Address two edge cases:
1. The brigade contains only META buckets.
  2. The last data bucket is of zero length.

Pointed out by: niq


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@610061 13f79535-47bb-0310-9956-ffa450edef68
2008-01-08 16:38:14 +00:00
Ruediger Pluem
a4f0699319 * HTTP error codes are int's not apr_status_t's.
Noted by: Takashi Sato <serai lans-tv.com>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@609609 13f79535-47bb-0310-9956-ffa450edef68
2008-01-07 13:52:49 +00:00
Ruediger Pluem
dc177a7d33 * Do not use local scoped apr_bucket_brigade. We use the same anyway, so we
can define it for the whole function.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@609552 13f79535-47bb-0310-9956-ffa450edef68
2008-01-07 10:21:00 +00:00
Ruediger Pluem
a30c35070c * Optimize and unify detection of blank / corrupt chunk size lines.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@609550 13f79535-47bb-0310-9956-ffa450edef68
2008-01-07 10:15:26 +00:00
Ruediger Pluem
dafa41ef4d * Move duplicated code for error handling into local function
(bail_out_on_error).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@609549 13f79535-47bb-0310-9956-ffa450edef68
2008-01-07 10:04:33 +00:00
Ruediger Pluem
05444df03a * Reuse bucket brigades instead of recreating them continously and thus
wasting memory if we have many chunks.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@609544 13f79535-47bb-0310-9956-ffa450edef68
2008-01-07 09:42:07 +00:00
Ruediger Pluem
8f1d7c06fe * Optimize assignments by using apr_pcalloc instead of apr_palloc.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@609541 13f79535-47bb-0310-9956-ffa450edef68
2008-01-07 09:29:00 +00:00
Ruediger Pluem
bf4f6247c7 * Optimize alignment.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@609540 13f79535-47bb-0310-9956-ffa450edef68
2008-01-07 09:26:53 +00:00
Ruediger Pluem
5982b66659 * Optimize solution from r609394 and remove chunk-extensions restriction that
was in r609394.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@609538 13f79535-47bb-0310-9956-ffa450edef68
2008-01-07 09:19:46 +00:00
Ruediger Pluem
56f4552f4f * Fix cases with non blocking reads from the ap_http_filter input filter where
chunk size lines or empty lines after a chunk are read incomplete. This can
  lead to a corruption inside the dechunking algorithm.
  This patch has an issue with larger chunk-extensions which need to get thrown
  away since we ignore them anyway.

PR: 19954, 41056
Tested by: niq


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@609394 13f79535-47bb-0310-9956-ffa450edef68
2008-01-06 20:32:20 +00:00
William A. Rowe Jr
911ed59e9c What's left can exceed size_t
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@605400 13f79535-47bb-0310-9956-ffa450edef68
2007-12-19 03:09:34 +00:00
Jeff Trawick
037475eaf9 http_protocol: Escape request method in 405 error reporting.
This has no security impact since the browser cannot be tricked
into sending arbitrary method strings.

(words from jorton)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@603346 13f79535-47bb-0310-9956-ffa450edef68
2007-12-11 20:08:12 +00:00
Ruediger Pluem
826016b3fd * Do not split the brigade if the flush bucket is the last bucket in the brigade.
PR: 23567
Submitted by: Stefan Fritsch <sf sfritsch.de>
Reviewed by: rpluem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@602735 13f79535-47bb-0310-9956-ffa450edef68
2007-12-09 22:03:10 +00:00
Justin Erenkrantz
1955b2e9e0 Case statements should go on their own line. (No functional change.)
* modules/http/http_filters.c
  (ap_http_filter): Put case on its own line.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@602657 13f79535-47bb-0310-9956-ffa450edef68
2007-12-09 10:48:54 +00:00
Ruediger Pluem
69f198a6ea * If no data is available at this point of time we need to switch into the
BODY_CHUNK_PART state like we do several lines later in the code in the
  same situation.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@602349 13f79535-47bb-0310-9956-ffa450edef68
2007-12-08 09:23:26 +00:00
William A. Rowe Jr
e95d52f53f http_protocol: Escape request method in 413 error reporting.
Determined to be not generally exploitable, but a flaw in any case.

PR: 44014
Submitted by: Victor Stinner <victor.stinner inl.fr>




git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@600645 13f79535-47bb-0310-9956-ffa450edef68
2007-12-03 19:45:48 +00:00
Nick Kew
d959bd155c Typo fix
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@599137 13f79535-47bb-0310-9956-ffa450edef68
2007-11-28 20:37:08 +00:00
Nick Kew
5b9b8da66f Fix patch to PR#43882 as pointed out by trawick
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@599059 13f79535-47bb-0310-9956-ffa450edef68
2007-11-28 16:50:28 +00:00
Nick Kew
14188af9f1 Safer fix to PR43882 than in r595672.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@595954 13f79535-47bb-0310-9956-ffa450edef68
2007-11-17 14:36:58 +00:00