httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cliff Woolley <cliffwool...@yahoo.com>
Subject byterange filter + apr_brigade_partition
Date Thu, 07 Jun 2001 23:38:49 GMT

Hey...

I'm finally getting around to applying the six-month-old patch to change
the prototype for apr_brigade_partition() to this:

APU_DECLARE(apr_status_t) apr_brigade_partition(apr_bucket_brigade *b,
                                                apr_off_t point,
                                                apr_bucket **after_point)

This is so that the caller can have more information when a failure
occurs, and was at the request of Greg Stein when the function first came
into existence.  The patch just slipped through the cracks and was
forgotten since then.

Anyway, I'll have to patch the byterange filter in Apache to account for
the change, and I'm looking for input on what the correct action is when a
failure actually occurs.  Right now, Apache doesn't test for a failure to
partition (which would have been indicated by a NULL return value) at all.
So in the code below, what would be the right thing to stick in the "XXX:
handle error" spot?

Thanks,
Cliff



Index: http_protocol.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/http/http_protocol.c,v
retrieving revision 1.324
diff -u -d -r1.324 http_protocol.c
--- http_protocol.c	2001/06/06 19:30:49	1.324
+++ http_protocol.c	2001/06/07 23:31:39
@@ -2317,6 +2317,7 @@
            (rv = parse_byterange(current, clength, &range_start, &range_end))) {
         apr_bucket *e2;
         apr_bucket *ec;
+        apr_status_t rvstart, rvend;

         if (rv == -1) {
             continue;
@@ -2339,8 +2340,11 @@
             APR_BRIGADE_INSERT_TAIL(bsend, e);
         }

-        e = apr_brigade_partition(bb, range_start);
-        e2 = apr_brigade_partition(bb, range_end + 1);
+        rvstart = apr_brigade_partition(bb, range_start, &e);
+        rvend   = apr_brigade_partition(bb, range_end + 1, &e2);
+        if ((rvstart != APR_SUCCESS) || (rvend != APR_SUCCESS)) {
+            /* XXX: handle error */
+        }

         ec = e;
         do {


--------------------------------------------------------------
   Cliff Woolley
   cliffwoolley@yahoo.com
   Charlottesville, VA



Mime
View raw message