Changes with Apache 2.0.33-dev
+ *) mod-include: make it handle flush'es and fix the 'false-alarm'
+ [Justin Everkrantz, Brian Pane, Ian Holsman]
*) ap_get_*_filter_handle() functions to allow 3rd party modules
to lookup filter handles so they can bypass the filter name
break;
}
- if (ctx->bytes_parsed >= BYTE_COUNT_THRESHOLD) {
+ if (APR_BUCKET_IS_FLUSH(dptr)) {
+ apr_bucket *old = dptr;
+ dptr = APR_BUCKET_NEXT(old);
+ APR_BUCKET_REMOVE(old);
+ ctx->output_now = 1;
+ ctx->output_flush = 1;
+ }
+ else if (ctx->bytes_parsed >= BYTE_COUNT_THRESHOLD) {
ctx->output_now = 1;
}
else if (ctx->bytes_parsed > 0) {
}
/* False alarm...
- * send out the unmatched part
*/
- if (ctx->parse_pos > 0) {
+ /* send out the unmatched part
+ */
+
+ if ((ctx->parse_pos > 0) && (ctx->bytes_parsed == 0)) {
apr_bucket *tmp_buck;
tmp_buck = apr_bucket_pool_create(apr_pstrndup(ctx->pool,
ctx->start_seq,
ctx->pool);
APR_BUCKET_INSERT_BEFORE(dptr, tmp_buck);
}
+
+
ctx->state = PRE_HEAD;
}
}
dptr = APR_BUCKET_NEXT(dptr);
} while (dptr != APR_BRIGADE_SENTINEL(bb));
+
+
return NULL;
}
if (APR_BUCKET_IS_EOS(dptr)) {
break;
}
- if (ctx->bytes_parsed >= BYTE_COUNT_THRESHOLD) {
+ if (APR_BUCKET_IS_FLUSH(dptr)) {
+ apr_bucket *old = dptr;
+ dptr = APR_BUCKET_NEXT(old);
+ APR_BUCKET_REMOVE(old);
+ ctx->output_now = 1;
+ ctx->output_flush = 1;
+ }
+ else if (ctx->bytes_parsed >= BYTE_COUNT_THRESHOLD) {
ctx->output_now = 1;
}
else if (ctx->bytes_parsed > 0) {
(ctx->bytes_parsed >= BYTE_COUNT_THRESHOLD))) {
/* Send the large chunk of pre-tag bytes... */
tag_and_after = apr_brigade_split(*bb, tmp_dptr);
+ if (ctx->output_flush) {
+ APR_BRIGADE_INSERT_TAIL(*bb, apr_bucket_flush_create());
+ }
+
rv = ap_pass_brigade(f->next, *bb);
if (rv != APR_SUCCESS) {
return rv;
}
*bb = tag_and_after;
dptr = tmp_dptr;
+ ctx->output_flush = 0;
ctx->bytes_parsed = 0;
ctx->output_now = 0;
}
if (rv != APR_SUCCESS) {
return rv;
}
+ ctx->output_flush = 0;
ctx->output_now = 0;
}
}
int bytes_parsed;
apr_status_t status;
int output_now;
+ int output_flush;
apr_bucket *head_start_bucket;
apr_size_t head_start_index;
apr_bucket_brigade *tag_plus; \
\
tag_plus = apr_brigade_split(brgd, cntxt->head_start_bucket); \
+ if (cntxt->output_flush) { \
+ APR_BRIGADE_INSERT_TAIL(brgd, apr_bucket_flush_create()); \
+ } \
rc = ap_pass_brigade(next, brgd); \
cntxt->bytes_parsed = 0; \
brgd = tag_plus; \