* first brigade to be sent from a given filter.
*/
struct ap_bucket_error {
+ /** Number of buckets using this memory */
+ apr_bucket_refcount refcount;
/** The error code */
int status;
/** The error string */
return APR_SUCCESS;
}
+static void error_bucket_destroy(void *data)
+{
+ ap_bucket_error *h = data;
+
+ if (apr_bucket_shared_destroy(h)) {
+ apr_bucket_free(h);
+ }
+}
+
AP_DECLARE(apr_bucket *) ap_bucket_error_make(apr_bucket *b, int error,
const char *buf, apr_pool_t *p)
{
h->status = error;
h->data = (buf) ? apr_pstrdup(p, buf) : NULL;
- b->length = 0;
- b->start = 0;
+ b = apr_bucket_shared_make(b, h, 0, 0);
b->type = &ap_bucket_type_error;
- b->data = h;
return b;
}
AP_DECLARE_DATA const apr_bucket_type_t ap_bucket_type_error = {
"ERROR", 5,
- apr_bucket_free,
+ error_bucket_destroy,
error_bucket_read,
apr_bucket_setaside_notimpl,
apr_bucket_split_notimpl,
- apr_bucket_simple_copy
+ apr_bucket_shared_copy
};