From 29e68ae602bb46049072289c888f7cf8d0b052e4 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 18 Sep 2000 01:24:55 +0000 Subject: [PATCH] Change r->filters to r->output_filters. This sets things up for us to put input filters into Apache. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86246 13f79535-47bb-0310-9956-ffa450edef68 --- include/httpd.h | 9 +++++++-- modules/generators/mod_cgi.c | 4 ++-- modules/generators/mod_cgid.c | 4 ++-- modules/http/http_core.c | 2 +- modules/http/http_protocol.c | 14 +++++++------- modules/http/http_request.c | 4 ++-- server/util_filter.c | 10 +++++----- 7 files changed, 26 insertions(+), 21 deletions(-) diff --git a/include/httpd.h b/include/httpd.h index f3f0492a2e..73eb089e6a 100644 --- a/include/httpd.h +++ b/include/httpd.h @@ -808,10 +808,15 @@ struct request_rec { struct ap_rr_xlate *rrx; #endif /*APACHE_XLATE*/ - /** A list of filters to be used for this request + /** A list of output filters to be used for this request * @defvar ap_filter_t *filters */ - struct ap_filter_t *filters; + struct ap_filter_t *output_filters; + /** A flag to determine if the eos bucket has been sent yet + * @defvar int eos_sent */ int eos_sent; + /** A list of output filters to be used for this request + * @defvar ap_filter_t *filters */ + struct ap_filter_t *input_filters; /* Things placed at the end of the record to avoid breaking binary * compatibility. It would be nice to remember to reorder the entire diff --git a/modules/generators/mod_cgi.c b/modules/generators/mod_cgi.c index b8cc3c1124..6a02344a4f 100644 --- a/modules/generators/mod_cgi.c +++ b/modules/generators/mod_cgi.c @@ -661,7 +661,7 @@ static int cgi_handler(request_rec *r) AP_BRIGADE_INSERT_TAIL(bb, b); b = ap_bucket_create_eos(); AP_BRIGADE_INSERT_TAIL(bb, b); - ap_pass_brigade(r->filters, bb); + ap_pass_brigade(r->output_filters, bb); } log_script_err(r, script_err); @@ -674,7 +674,7 @@ static int cgi_handler(request_rec *r) AP_BRIGADE_INSERT_TAIL(bb, b); b = ap_bucket_create_eos(); AP_BRIGADE_INSERT_TAIL(bb, b); - ap_pass_brigade(r->filters, bb); + ap_pass_brigade(r->output_filters, bb); } return OK; /* NOT r->status, even if it has changed. */ diff --git a/modules/generators/mod_cgid.c b/modules/generators/mod_cgid.c index 690f07d7d8..d09249e983 100644 --- a/modules/generators/mod_cgid.c +++ b/modules/generators/mod_cgid.c @@ -1014,7 +1014,7 @@ static int cgid_handler(request_rec *r) AP_BRIGADE_INSERT_TAIL(bb, b); b = ap_bucket_create_eos(); AP_BRIGADE_INSERT_TAIL(bb, b); - ap_pass_brigade(r->filters, bb); + ap_pass_brigade(r->output_filters, bb); } } @@ -1024,7 +1024,7 @@ static int cgid_handler(request_rec *r) AP_BRIGADE_INSERT_TAIL(bb, b); b = ap_bucket_create_eos(); AP_BRIGADE_INSERT_TAIL(bb, b); - ap_pass_brigade(r->filters, bb); + ap_pass_brigade(r->output_filters, bb); } apr_close(tempsock); diff --git a/modules/http/http_core.c b/modules/http/http_core.c index 18eff8d393..63082553ec 100644 --- a/modules/http/http_core.c +++ b/modules/http/http_core.c @@ -186,7 +186,7 @@ static void *create_core_dir_config(apr_pool_t *a, char *dir) conf->add_default_charset = ADD_DEFAULT_CHARSET_UNSET; conf->add_default_charset_name = DEFAULT_ADD_DEFAULT_CHARSET_NAME; - conf->filters = apr_make_array(a, 40, sizeof(void *)); + conf->filters = apr_make_array(a, 2, sizeof(void *)); return (void *)conf; } diff --git a/modules/http/http_protocol.c b/modules/http/http_protocol.c index 3438cf7f4c..e7cc8f0a86 100644 --- a/modules/http/http_protocol.c +++ b/modules/http/http_protocol.c @@ -1358,7 +1358,7 @@ static void end_output_stream(request_rec *r) bb = ap_brigade_create(r->pool); b = ap_bucket_create_eos(); AP_BRIGADE_INSERT_TAIL(bb, b); - ap_pass_brigade(r->filters, bb); + ap_pass_brigade(r->output_filters, bb); } void ap_finalize_sub_req_protocol(request_rec *sub) @@ -2742,7 +2742,7 @@ API_EXPORT(size_t) ap_send_mmap(apr_mmap_t *mm, request_rec *r, size_t offset, bb = ap_brigade_create(r->pool); b = ap_bucket_create_mmap(mm, 0, mm->size); AP_BRIGADE_INSERT_TAIL(bb, b); - ap_pass_brigade(r->filters, bb); + ap_pass_brigade(r->output_filters, bb); return mm->size; /* XXX - change API to report apr_status_t? */ } @@ -2761,7 +2761,7 @@ API_EXPORT(int) ap_rputc(int c, request_rec *r) bb = ap_brigade_create(r->pool); b = ap_bucket_create_transient(&c2, 1); AP_BRIGADE_INSERT_TAIL(bb, b); - ap_pass_brigade(r->filters, bb); + ap_pass_brigade(r->output_filters, bb); return c; } @@ -2781,7 +2781,7 @@ API_EXPORT(int) ap_rputs(const char *str, request_rec *r) bb = ap_brigade_create(r->pool); b = ap_bucket_create_transient(str, len); AP_BRIGADE_INSERT_TAIL(bb, b); - ap_pass_brigade(r->filters, bb); + ap_pass_brigade(r->output_filters, bb); return len; } @@ -2799,7 +2799,7 @@ API_EXPORT(int) ap_rwrite(const void *buf, int nbyte, request_rec *r) bb = ap_brigade_create(r->pool); b = ap_bucket_create_transient(buf, nbyte); AP_BRIGADE_INSERT_TAIL(bb, b); - ap_pass_brigade(r->filters, bb); + ap_pass_brigade(r->output_filters, bb); return nbyte; } @@ -2814,7 +2814,7 @@ API_EXPORT(int) ap_vrprintf(request_rec *r, const char *fmt, va_list va) bb = ap_brigade_create(r->pool); written = ap_brigade_vprintf(bb, fmt, va); if (written != 0) - ap_pass_brigade(r->filters, bb); + ap_pass_brigade(r->output_filters, bb); return written; } @@ -2849,7 +2849,7 @@ API_EXPORT_NONSTD(int) ap_rvputs(request_rec *r, ...) written = ap_brigade_vputstrs(bb, va); va_end(va); if (written != 0) - ap_pass_brigade(r->filters, bb); + ap_pass_brigade(r->output_filters, bb); return written; } diff --git a/modules/http/http_request.c b/modules/http/http_request.c index 72d7764f06..a4b2fcfb08 100644 --- a/modules/http/http_request.c +++ b/modules/http/http_request.c @@ -778,7 +778,7 @@ API_EXPORT(request_rec *) ap_sub_req_method_uri(const char *method, ap_copy_method_list(rnew->allowed_methods, r->allowed_methods); /* start with the same set of output filters */ - rnew->filters = r->filters; + rnew->output_filters = r->output_filters; ap_set_sub_req_protocol(rnew, r); @@ -873,7 +873,7 @@ API_EXPORT(request_rec *) ap_sub_req_lookup_file(const char *new_file, ap_copy_method_list(rnew->allowed_methods, r->allowed_methods); /* start with the same set of output filters */ - rnew->filters = r->filters; + rnew->output_filters = r->output_filters; ap_set_sub_req_protocol(rnew, r); fdir = ap_make_dirstr_parent(rnew->pool, r->filename); diff --git a/server/util_filter.c b/server/util_filter.c index ce949a8326..6fbd18368a 100644 --- a/server/util_filter.c +++ b/server/util_filter.c @@ -111,12 +111,12 @@ API_EXPORT(void) ap_add_filter(const char *name, void *ctx, request_rec *r) f->ctx = ctx; f->r = r; - if (INSERT_BEFORE(f, r->filters)) { - f->next = r->filters; - r->filters = f; + if (INSERT_BEFORE(f, r->output_filters)) { + f->next = r->output_filters; + r->output_filters = f; } else { - ap_filter_t *fscan = r->filters; + ap_filter_t *fscan = r->output_filters; while (!INSERT_BEFORE(f, fscan->next)) fscan = fscan->next; f->next = fscan->next; @@ -131,7 +131,7 @@ API_EXPORT(void) ap_add_filter(const char *name, void *ctx, request_rec *r) /* Pass the buckets to the next filter in the filter stack. If the * current filter is a handler, we should get NULL passed in instead of * the current filter. At that point, we can just call the first filter in - * the stack, or r->filters. + * the stack, or r->output_filters. */ API_EXPORT(apr_status_t) ap_pass_brigade(ap_filter_t *next, ap_bucket_brigade *bb) { -- 2.40.0