From: Ryan Bloom Date: Fri, 13 Oct 2000 05:35:57 +0000 (+0000) Subject: Remove all function pointers from the ap_bucket type. These function X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2effcf0f07892b99e86cdf7e08c591aab6067ed1;p=apache Remove all function pointers from the ap_bucket type. These function pointers are replaced with a global table that allows modules to register their bucket types. Those bucket types are then allowed to be used in the server processing. This also required removing all direct calls to those functions. The ap_bucket type has an index into an array, so in each ap_bucket_* function, we use that index to find the correct set of functions. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86575 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/experimental/mod_charset_lite.c b/modules/experimental/mod_charset_lite.c index 992c42220d..ee1b0e3b13 100644 --- a/modules/experimental/mod_charset_lite.c +++ b/modules/experimental/mod_charset_lite.c @@ -688,7 +688,7 @@ static apr_status_t xlate_filter(ap_filter_t *f, ap_bucket_brigade *bb) } break; } - rv = dptr->read(dptr, &cur_str, &cur_len, 0); + rv = ap_bucket_read(dptr, &cur_str, &cur_len, 0); if (rv != APR_SUCCESS) { done = 1; ctx->ees = EES_BUCKET_READ; diff --git a/modules/filters/mod_include.c b/modules/filters/mod_include.c index 5514e247c7..1c27509898 100644 --- a/modules/filters/mod_include.c +++ b/modules/filters/mod_include.c @@ -190,10 +190,10 @@ static ap_bucket *find_string(ap_bucket *dptr, const char *str, ap_bucket *end) int state = 0; do { - if (dptr->type == AP_BUCKET_EOS) { + if (dptr->type == ap_eos_type()) { break; } - dptr->read(dptr, &buf, &len, 0); + ap_bucket_read(dptr, &buf, &len, 0); /* XXX handle retcodes */ if (len == 0) { /* end of pipe? */ break; @@ -210,10 +210,10 @@ static ap_bucket *find_string(ap_bucket *dptr, const char *str, ap_bucket *end) * on what we are searching for. */ if (str[0] == '<') { - dptr->split(dptr, c - buf - strlen(str)); + ap_bucket_split(dptr, c - buf - strlen(str)); } else { - dptr->split(dptr, c - buf); + ap_bucket_split(dptr, c - buf); } return AP_BUCKET_NEXT(dptr); } @@ -348,7 +348,7 @@ static char *get_tag(apr_pool_t *p, ap_bucket *in, char *tag, int tagbuf_len, in /* Remove all whitespace */ while (dptr) { - dptr->read(dptr, &str, &length, 0); + ap_bucket_read(dptr, &str, &length, 0); c = str + *offset; while (c - str < length) { if (!apr_isspace(*c)) { @@ -365,14 +365,14 @@ static char *get_tag(apr_pool_t *p, ap_bucket *in, char *tag, int tagbuf_len, in if (*c == '-') { c++; if (c == '\0') { - dptr->read(dptr, &str, &length, 0); + ap_bucket_read(dptr, &str, &length, 0); c = str; } if (*c == '-') { do { c++; if (c == '\0') { - dptr->read(dptr, &str, &length, 0); + ap_bucket_read(dptr, &str, &length, 0); c = str; } } while (apr_isspace(*c)); @@ -397,7 +397,7 @@ static char *get_tag(apr_pool_t *p, ap_bucket *in, char *tag, int tagbuf_len, in *(t++) = apr_tolower(*c); c++; if (c == '\0') { - dptr->read(dptr, &str, &length, 0); + ap_bucket_read(dptr, &str, &length, 0); c = str; } } @@ -408,7 +408,7 @@ static char *get_tag(apr_pool_t *p, ap_bucket *in, char *tag, int tagbuf_len, in while (apr_isspace(*c)) { c++; if (c == '\0') { - dptr->read(dptr, &str, &length, 0); + ap_bucket_read(dptr, &str, &length, 0); c = str; } } @@ -420,7 +420,7 @@ static char *get_tag(apr_pool_t *p, ap_bucket *in, char *tag, int tagbuf_len, in do { c++; if (c == '\0') { - dptr->read(dptr, &str, &length, 0); + ap_bucket_read(dptr, &str, &length, 0); c = str; } } while (apr_isspace(*c)); @@ -434,7 +434,7 @@ static char *get_tag(apr_pool_t *p, ap_bucket *in, char *tag, int tagbuf_len, in while (1) { c++; if (c == '\0') { - dptr->read(dptr, &str, &length, 0); + ap_bucket_read(dptr, &str, &length, 0); c = str; } if (t - tag == tagbuf_len) { @@ -446,7 +446,7 @@ static char *get_tag(apr_pool_t *p, ap_bucket *in, char *tag, int tagbuf_len, in *(t++) = *c; /* Add backslash */ c++; if (c == '\0') { - dptr->read(dptr, &str, &length, 0); + ap_bucket_read(dptr, &str, &length, 0); c = str; } if (*c == term) { /* Only if */ @@ -478,7 +478,7 @@ static int get_directive(ap_bucket *in, char *dest, size_t len, apr_pool_t *p) --len; while (dptr) { - dptr->read(dptr, &str, &length, 0); + ap_bucket_read(dptr, &str, &length, 0); /* need to start past the