Changes with Apache 2.0.19-dev
+ *) Fix problem handling FLUSH bucket in the chunked encoding filter.
+ Module was calling ap_rwrite() followed by ap_rflush() but the
+ served content was not being displayed in the browser. Inspection
+ of the output stream revealed that the first data chunk was
+ missing the trailing CRLF required by the RFC.
+
*) apxs no longer generates ap_send_http_header() in the example handler
*) Fix an ab problem which could cause a divide-by-zero exception
for (more = NULL; b; b = more, more = NULL) {
apr_off_t bytes = 0;
apr_bucket *eos = NULL;
+ apr_bucket *flush = NULL;
char chunk_hdr[20]; /* enough space for the snprintf below */
APR_BRIGADE_FOREACH(e, b) {
eos = e;
break;
}
+ if (APR_BUCKET_IS_FLUSH(e)) {
+ flush = e;
+ }
else if (e->length == -1) {
/* unknown amount of data (e.g. a pipe) */
const char *data;
APR_BRIGADE_INSERT_HEAD(b, e);
/*
- * Insert the end-of-chunk CRLF before the EOS bucket, or
- * appended to the brigade
+ * Insert the end-of-chunk CRLF before an EOS or
+ * FLUSH bucket, or appended to the brigade
*/
e = apr_bucket_immortal_create(ASCII_CRLF, 2);
if (eos != NULL) {
APR_BUCKET_INSERT_BEFORE(eos, e);
}
+ else if (flush != NULL) {
+ APR_BUCKET_INSERT_BEFORE(flush, e);
+ }
else {
APR_BRIGADE_INSERT_TAIL(b, e);
}