]> granicus.if.org Git - apache/commitdiff
Fix inserting elements at the head and tail of a ring when the ring is
authorTony Finch <fanf@apache.org>
Sat, 9 Sep 2000 01:11:15 +0000 (01:11 +0000)
committerTony Finch <fanf@apache.org>
Sat, 9 Sep 2000 01:11:15 +0000 (01:11 +0000)
empty. Avoiding referring to the element type in the macros resulted
in some double dereferences that did the wrong thing.
Reported by: Jeff Trawick

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86184 13f79535-47bb-0310-9956-ffa450edef68

modules/http/http_core.c

index cdedb158217f8711c731d394a997f0f1aa096a01..e302dfd012e87641fe26658fd216e7f4ac902987 100644 (file)
@@ -2930,14 +2930,14 @@ static apr_status_t pass_chunk(ap_filter_t *f, ap_bucket_brigade *b,
     }
     hdr_len = apr_snprintf(chunk_hdr, sizeof(chunk_hdr), "%qx" CRLF, bytes);
     e = ap_bucket_create_transient(chunk_hdr, hdr_len);
-    AP_RING_INSERT_HEAD(&b->list, e, link);
+    AP_RING_INSERT_HEAD(&b->list, e, ap_bucket, link);
     if (eos) {
        /* any trailer should go between the last two CRLFs */
        e = ap_bucket_create_immortal(CRLF "0" CRLF CRLF, 7);
        AP_RING_INSERT_BEFORE(AP_RING_LAST(&b->list), e, link);
     } else {
        e = ap_bucket_create_immortal(CRLF, 2);
-       AP_RING_INSERT_TAIL(&b->list, e, link);
+       AP_RING_INSERT_TAIL(&b->list, e, ap_bucket, link);
     }
     return ap_pass_brigade(f->next, b);
 }