bb = input_brigade;
}
+ /* The request is flushed below this loop with chunk EOS header */
status = pass_brigade(bucket_alloc, r, p_conn, origin, bb, 0);
if (status != APR_SUCCESS) {
return status;
AP_DEBUG_ASSERT(APR_BUCKET_IS_EOS(e));
apr_bucket_delete(e);
}
- e = apr_bucket_immortal_create(ASCII_ZERO ASCII_CRLF
- /* <trailers> */
- ASCII_CRLF,
- 5, bucket_alloc);
- APR_BRIGADE_INSERT_TAIL(input_brigade, e);
bb = input_brigade;
}
-
+
+ e = apr_bucket_immortal_create(ASCII_ZERO ASCII_CRLF
+ /* <trailers> */
+ ASCII_CRLF,
+ 5, bucket_alloc);
+ APR_BRIGADE_INSERT_TAIL(bb, e);
+
+ /* Now we have headers-only, or the chunk EOS mark; flush it */
status = pass_brigade(bucket_alloc, r, p_conn, origin, bb, 1);
return status;
}
bb = input_brigade;
}
- status = pass_brigade(bucket_alloc, r, p_conn, origin, bb, 0);
+ /* Once we hit EOS, we are ready to flush. */
+ status = pass_brigade(bucket_alloc, r, p_conn, origin, bb, seen_eos);
if (status != APR_SUCCESS) {
return status;
}
if (header_brigade) {
/* we never sent the header brigade since there was no request
- * body; send it now
+ * body; send it now with the flush flag
*/
terminate_headers(bucket_alloc, header_brigade);
bb = header_brigade;
+ status = pass_brigade(bucket_alloc, r, p_conn, origin, bb, 1);
}
- else {
- /* need to flush any pending data */
- bb = input_brigade; /* empty now; pass_brigade() will add flush */
- }
- status = pass_brigade(bucket_alloc, r, p_conn, origin, bb, 1);
return status;
}
}
APR_BRIGADE_INSERT_TAIL(header_brigade, e);
}
+ /* This is all a single brigade, pass with flush flagged */
status = pass_brigade(bucket_alloc, r, p_conn, origin, header_brigade, 1);
return status;
}