Apache 2.0 STATUS:
-Last modified at [$Date: 2000/10/13 16:57:08 $]
+Last modified at [$Date: 2000/10/16 23:15:54 $]
Release:
* 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 mark the end of a subrequest content stream, and one to tell
- filters to flush any pending content. See http_protocol.c:
- ap_finalize_sub_req_protocol() and ap_rflush()
- rbb says: Creating a bucket to signal end of sub-request ties
- the filters to Apache. This can be handled very cleanly
- by just inserting a sub-request filter. That filter would
- be responsible for stripping off the EOS bucket for the
- sub-request, and removing all vestiges of the request.
+ to tell filters to flush any pending content. See http_protocol.c:
+ ap_rflush()
* Remove Buff from the code. Some buff functionality is currently
missing: input translation filter, translation of protocol data for
#define APACHE_HTTP_REQUEST_H
#include "ap_hooks.h"
+#include "util_filter.h"
#ifdef __cplusplus
extern "C" {
AP_DECLARE(request_rec *) ap_sub_req_method_uri(const char *method,
const char *new_file,
const request_rec *r);
+/**
+ * An output filter to strip EOS buckets from sub-requests. This always
+ * has to be inserted at the end of a sub-requests filter stack.
+ * @param f The current filter
+ * @param bb The brigade to filter
+ * @deffuc apr_status_t ap_sub_req_output_filter(ap_filter_t *f, ap_bucket_brigade *bb)
+ */
+AP_CORE_DECLARE(apr_status_t) ap_sub_req_output_filter(ap_filter_t *f,
+ ap_bucket_brigade *bb);
/**
* Run the handler for the sub request
ap_register_input_filter("DECHUNK", dechunk_filter, AP_FTYPE_CONNECTION + 1);
ap_register_input_filter("CORE_IN", core_input_filter, AP_FTYPE_CONNECTION);
ap_register_output_filter("CORE", core_output_filter, AP_FTYPE_CONNECTION + 1);
+ ap_register_output_filter("SUBREQ_CORE", ap_sub_req_output_filter,
+ AP_FTYPE_CONTENT);
ap_register_output_filter("CHUNK", chunk_filter, AP_FTYPE_CONNECTION);
ap_register_output_filter("BUFFER", buffer_filter, AP_FTYPE_CONNECTION);
}
void ap_finalize_sub_req_protocol(request_rec *sub)
{
- /* tell the filter chain there is no more content coming */
- /* ### crap. we need to tell the subrequest's filters that no more
- ### is coming. there is definitely more for the parent requests.
- ### create a SUB_EOS bucket?
- */
- /* end_output_stream(sub); */
+ end_output_stream(sub);
SET_BYTES_SENT(sub->main);
}
return rr;
}
+AP_CORE_DECLARE(apr_status_t) ap_sub_req_output_filter(ap_filter_t *f,
+ ap_bucket_brigade *bb)
+{
+ ap_bucket *e = AP_BRIGADE_LAST(bb);
+
+ if (AP_BUCKET_IS_EOS(e)) {
+ AP_BUCKET_REMOVE(e);
+ ap_bucket_destroy(e);
+ }
+ ap_pass_brigade(f->next, bb);
+ return APR_SUCCESS;
+}
+
AP_DECLARE(request_rec *) ap_sub_req_method_uri(const char *method,
const char *new_file,
const request_rec *r)
/* start with the same set of output filters */
rnew->output_filters = r->output_filters;
+ ap_add_output_filter("SUBREQ_CORE", NULL, rnew, rnew->connection);
+
/* no input filters for a subrequest */
ap_set_sub_req_protocol(rnew, r);
/* start with the same set of output filters */
rnew->output_filters = r->output_filters;
+ ap_add_output_filter("SUBREQ_CORE", NULL, rnew, rnew->connection);
+
/* no input filters for a subrequest */
ap_set_sub_req_protocol(rnew, r);