they are currently storing. There is no way we can force them to flush,
but we can advise. This also adds the code to ap_rflush to use flush
buckets, although it isn't enabled yet. I will enable it once we remove
buff from the code. I also removed all calls to ap_rflush that are either
immediately before or immediately after a call to ap_finalize_protocol.
ap_finalize_protocol sends an EOS bucket, which also advises filters to
flush their data, so having both calls right next to each other is
redundant.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86619
13f79535-47bb-0310-9956-
ffa450edef68
Apache 2.0 STATUS:
-Last modified at [$Date: 2000/10/16 23:15:54 $]
+Last modified at [$Date: 2000/10/17 00:24:28 $]
Release:
WIN32 and OS2 need review [William Rowe, Brian Harvard]
* All of the bucket types must be implemented. The list can be found
- in src/include/ap_buckets.h. May need to implement a bucket type
- to tell filters to flush any pending content. See http_protocol.c:
- ap_rflush()
+ in src/include/ap_buckets.h.
* Remove Buff from the code. Some buff functionality is currently
missing: input translation filter, translation of protocol data for
destroy_me = NULL;
}
if (AP_BUCKET_IS_EOS(e) || AP_BUCKET_IS_FILE(e) ||
- AP_BUCKET_IS_PIPE(e)) {
+ AP_BUCKET_IS_PIPE(e) || AP_BUCKET_IS_FLUSH(e)) {
pass_the_brigade = 1;
}
else {
/* Completed iterating over the brigades, now determine if we want to
* buffer the brigade or send the brigade out on the network
*/
- if (!fd && (!more) && (nbytes < MIN_SIZE_TO_WRITE) && !AP_BUCKET_IS_EOS(e)) {
+ if (!fd && (!more) && (nbytes < MIN_SIZE_TO_WRITE) && !AP_BUCKET_IS_EOS(e) && !AP_BUCKET_IS_FLUSH(e)) {
ap_save_brigade(f, &ctx->b, &b);
return APR_SUCCESS;
}
AP_DECLARE(int) ap_rflush(request_rec *r)
{
- /* ### this is probably incorrect, but we have no mechanism for telling
- ### the filter chain to flush any content they may be holding.
-
- ### add a FLUSH bucket type?
- */
-
apr_status_t rv;
if ((rv = ap_bflush(r->connection->client)) != APR_SUCCESS) {
check_first_conn_error(r, "rflush", rv);
return EOF;
}
+#if USE_FLUSH_BUCKET
+ /* we should be using a flush bucket to flush the stack, not buff code. */
+ ap_bucket_brigade *bb;
+ ap_bucket *b;
+
+ bb = ap_brigade_create(r->pool);
+ b = ap_bucket_create_flush();
+ AP_BRIGADE_INSERT_TAIL(bb, b);
+ ap_pass_brigade(r->output_filters, bb);
+#endif
return 0;
}
if (r->header_only) {
ap_finalize_request_protocol(r);
- ap_rflush(r);
return;
}
}
if (custom_response[0] == '\"') {
ap_rputs(custom_response + 1, r);
ap_finalize_request_protocol(r);
- ap_rflush(r);
return;
}
/*
ap_rputs("</BODY></HTML>\n", r);
}
ap_finalize_request_protocol(r);
- ap_rflush(r);
}
AP_IMPLEMENT_HOOK_RUN_ALL(int,post_read_request,
return;
}
- /* We need to flush the data out at this point. We probably only want to
- * do this on the main request, but this is fine for an initial patch.
- * Once we look into this more, we won't flush sub-requests.
- */
- ap_rflush(r);
-
/* Take care of little things that need to happen when we're done */
ap_finalize_request_protocol(r);
}