]> granicus.if.org Git - apache/commit
mod_dav improvement: make dav_method_propfind stream its response,
authorGreg Stein <gstein@apache.org>
Tue, 3 Jun 2003 22:09:24 +0000 (22:09 +0000)
committerGreg Stein <gstein@apache.org>
Tue, 3 Jun 2003 22:09:24 +0000 (22:09 +0000)
commit97a278f1b316b69cae7e3331671b47b460ec051e
treeedbe1c88be107f4a693124ee9b5befd28b9ec579
parentbea84dd0cf423edea251d612b77f574e097724a0
mod_dav improvement: make dav_method_propfind stream its response,
rather than cache every <response> object and send the whole 207 at once.

Note:  this patch doesn't affect the mod_dav provider API at all.
Providers still return property results in text-buffers, but mod_dav
then streams them out immediately.

Submitted by: Ben Collins-Sussman <sussman@collab.net>
Reviewed by: gstein, jerenkrantz, sander

* mod_dav.h (dav_walker_ctx): add a brigade field and a scratchpool field.

* mod_dav.c (dav_send_one_response): new helper function to write a
    <DAV:response> into a brigade/filter.  this code has been factorized
    out of dav_send_multistatus.

  (dav_begin_multistatus): new factorized helper func; creates brigade
    and sends initial <multistatus> tag.

  (dav_send_multistatus): create brigade, call dav_begin_multistatus,
    and switch all ap_rputs calls to ap_fputs instead.  call
    dav_send_one_response when looping over response list.  use a
    subpool when iterating.

  (dav_method_propfind): initialize walker ctx's brigade.  initialize
    ctx's scratchpool as a subpool of r->pool.  Send a <multistatus> tag
    before calling the provider's walk() function, and a </multistatus>
    tag afterwards.

  (dav_stream_response): new function, originally based on
    dav_add_repsonse.  don't build linked list of responses in memory;
    just spew each response object into the brigade via
    dav_send_one_response().  take an incoming pool argument to do the
    temporary allocation and streaming.

  (dav_propfind_walker): pass ctx->scratchpool to dav_stream_response,
    and clear the pool when finished.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100164 13f79535-47bb-0310-9956-ffa450edef68
modules/dav/main/mod_dav.c
modules/dav/main/mod_dav.h