temporary brigade in such a structure, to avoid having to allocate
a new brigade per invocation as described in the <a href="#brigade">Brigade structure</a> section.</p>
- <div class="example"><h3>Example code to maintain filter state</h3><pre class="prettyprint lang-c">struct dummy_state {
+ <div class="example"><h3>Example code to maintain filter state</h3><pre class="prettyprint lang-c">struct dummy_state {
apr_bucket_brigade *tmpbb;
int filter_state;
- ....
+ ...
};
apr_status_t dummy_filter(ap_filter_t *f, apr_bucket_brigade *bb)
/* First invocation for this response: initialise state structure.
*/
- f->ctx = state = apr_palloc(sizeof *state, f->r->pool);
+ f->ctx = state = apr_palloc(f->r->pool, sizeof *state);
state->tmpbb = apr_brigade_create(f->r->pool, f->c->bucket_alloc);
state->filter_state = ...;
a new brigade per invocation as described in the <a
href="#brigade">Brigade structure</a> section.</p>
- <example><title>Example code to maintain filter state</title>
- <highlight language="c">
+ <example><title>Example code to maintain filter state</title>
+<highlight language="c">
struct dummy_state {
apr_bucket_brigade *tmpbb;
int filter_state;
- ....
+ ...
};
apr_status_t dummy_filter(ap_filter_t *f, apr_bucket_brigade *bb)
/* First invocation for this response: initialise state structure.
*/
- f->ctx = state = apr_palloc(sizeof *state, f->r->pool);
+ f->ctx = state = apr_palloc(f->r->pool, sizeof *state);
state->tmpbb = apr_brigade_create(f->r->pool, f->c->bucket_alloc);
state->filter_state = ...;