httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 27576] New: - Patch to enable Keep-Alives with the multistatus response streamy function
Date Wed, 10 Mar 2004 18:05:08 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=27576>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=27576

Patch to enable Keep-Alives with the multistatus response streamy function

           Summary: Patch to enable Keep-Alives with the multistatus
                    response streamy function
           Product: Apache httpd-2.0
           Version: 2.0.48
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: mod_dav
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: ojd@aspectgroup.co.uk


By passing in NULL as the filter object, the brigade isnt flushed. At the end 
we can query the length of the data and set the Content-Length, and so allow 
Keep-Alives to work. The propfind method still supplies a filter object and so 
the possibly long responses will be streamed out.

Oli

diff -u mod_dav.c.orig mod_dav.c

--- mod_dav.c.orig      2004-03-10 17:49:48.000000000 +0000
+++ mod_dav.c   2004-03-10 15:03:49.000000000 +0000
@@ -524,7 +524,7 @@
    R->output_filters.  Use xml NAMESPACES in initial tag, if
    non-NULL. */
 static void dav_begin_multistatus(apr_bucket_brigade *bb,
-                                  request_rec *r, int status,
+                                  request_rec *r, ap_filter_t *output, int 
status,
                                   apr_array_header_t *namespaces)
 {
     /* Set the correct status and Content-Type */
@@ -532,19 +532,19 @@
     ap_set_content_type(r, DAV_XML_CONTENT_TYPE);
 
     /* Send the headers and actual multistatus response now... */
-    ap_fputs(r->output_filters, bb, DAV_XML_HEADER DEBUG_CR
+    ap_fputs(output, bb, DAV_XML_HEADER DEBUG_CR
              "<D:multistatus xmlns:D=\"DAV:\"");
 
     if (namespaces != NULL) {
        int i;
 
        for (i = namespaces->nelts; i--; ) {
-           ap_fprintf(r->output_filters, bb, " xmlns:ns%d=\"%s\"", i,
+           ap_fprintf(output, bb, " xmlns:ns%d=\"%s\"", i,
                       APR_XML_GET_URI_ITEM(namespaces, i));
        }
     }
 
-    ap_fputs(r->output_filters, bb, ">" DEBUG_CR);
+    ap_fputs(output, bb, ">" DEBUG_CR);
 }
 
 
@@ -556,17 +556,20 @@
     apr_bucket_brigade *bb = apr_brigade_create(r->pool,
                                                 r->connection->bucket_alloc);
 
-    dav_begin_multistatus(bb, r, status, namespaces);
+    dav_begin_multistatus(bb, r, NULL, status, namespaces);
 
     apr_pool_create(&subpool, r->pool);
 
     for (; first != NULL; first = first->next) {
       apr_pool_clear(subpool);
-      dav_send_one_response(first, bb, r->output_filters, subpool);
+      dav_send_one_response(first, bb, NULL, subpool);
     }
     apr_pool_destroy(subpool);
 
-    ap_fputs(r->output_filters, bb, "</D:multistatus>" DEBUG_CR);
+    ap_fputs(NULL, bb, "</D:multistatus>" DEBUG_CR);
+    apr_off_t len;
+    apr_brigade_length(bb,1,&len);
+    ap_set_content_length(r,len);
     ap_filter_flush(bb, r->output_filters);
 }
 
@@ -2049,7 +2052,7 @@
        404. Note that <response> elements will override these ns0,
        ns1, etc, but NOT within the <response> scope for the
        badprops. */
-    dav_begin_multistatus(ctx.bb, r, HTTP_MULTI_STATUS,
+    dav_begin_multistatus(ctx.bb, r, r->output_filters, HTTP_MULTI_STATUS,
                           doc ? doc->namespaces : NULL);
 
     /* Have the provider walk the resource. */

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


Mime
View raw message