}
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;
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;
* 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);
}
/* 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)) {
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));
*(t++) = apr_tolower(*c);
c++;
if (c == '\0') {
- dptr->read(dptr, &str, &length, 0);
+ ap_bucket_read(dptr, &str, &length, 0);
c = str;
}
}
while (apr_isspace(*c)) {
c++;
if (c == '\0') {
- dptr->read(dptr, &str, &length, 0);
+ ap_bucket_read(dptr, &str, &length, 0);
c = str;
}
}
do {
c++;
if (c == '\0') {
- dptr->read(dptr, &str, &length, 0);
+ ap_bucket_read(dptr, &str, &length, 0);
c = str;
}
} while (apr_isspace(*c));
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) {
*(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 */
--len;
while (dptr) {
- dptr->read(dptr, &str, &length, 0);
+ ap_bucket_read(dptr, &str, &length, 0);
/* need to start past the <!--#
*/
c = str + strlen(STARTING_SEQUENCE);
/* now get directive */
while (dptr) {
if (c - str >= length) {
- dptr->read(dptr, &str, &length, 0);
+ ap_bucket_read(dptr, &str, &length, 0);
}
while (c - str < length) {
if (d - dest == (int)len) {
ap_bucket_destroy(destroy_me);
destroy_me = NULL;
}
- if ((e->type == AP_BUCKET_EOS) || (e->type == AP_BUCKET_FILE) ||
- (e->type == AP_BUCKET_PIPE)) {
+ if ((e->type == ap_eos_type()) || (e->type == ap_file_type()) ||
+ (e->type == ap_pipe_type())) {
pass_the_brigade = 1;
}
else {
const char *str;
apr_ssize_t n;
- rv = e->read(e, &str, &n, 0);
+ rv = ap_bucket_read(e, &str, &n, 0);
if (rv != APR_SUCCESS) {
/* XXX: log error */
return rv;
char chunk_hdr[20]; /* enough space for the snprintf below */
AP_BRIGADE_FOREACH(e, b) {
- if (e->type == AP_BUCKET_EOS) {
+ if (e->type == ap_eos_type()) {
/* there shouldn't be anything after the eos */
eos = e;
break;
const char *data;
apr_ssize_t len;
- rv = e->read(e, &data, &len, 1);
+ rv = ap_bucket_read(e, &data, &len, 1);
if (rv != APR_SUCCESS) {
return rv;
}
nbytes = 0; /* in case more points to another brigade */
more = NULL;
AP_BRIGADE_FOREACH(e, b) {
- if (e->type == AP_BUCKET_EOS) {
+ if (e->type == ap_eos_type()) {
break;
}
- else if (e->type == AP_BUCKET_FILE) {
+ else if (e->type == ap_file_type()) {
ap_bucket_file *a = e->data;
/* Assume there is at most one AP_BUCKET_FILE in the brigade */
fd = a->fd;
else {
const char *str;
apr_ssize_t n;
- rv = e->read(e, &str, &n, 0);
+ rv = ap_bucket_read(e, &str, &n, 0);
if (n) {
nbytes += n;
if (!fd) {
/* 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) && (e->type != AP_BUCKET_EOS)) {
+ if (!fd && (!more) && (nbytes < MIN_SIZE_TO_WRITE) && (e->type != ap_eos_type())) {
ap_save_brigade(f, &ctx->b, &b);
return APR_SUCCESS;
}
{ NULL, NULL }
};
+static void core_pre_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp)
+{
+ ap_init_bucket_types(pconf);
+}
+
static void core_post_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s)
{
ap_set_version(pconf);
static void register_hooks(void)
{
+ ap_hook_pre_config(core_pre_config, NULL, NULL, AP_HOOK_REALLY_FIRST);
ap_hook_post_config(core_post_config,NULL,NULL,AP_HOOK_REALLY_FIRST);
ap_hook_translate_name(ap_core_translate,NULL,NULL,AP_HOOK_REALLY_LAST);
ap_hook_pre_connection(ap_pre_http_connection,NULL,NULL,
e = AP_BRIGADE_FIRST(b);
while (e != AP_BRIGADE_SENTINEL(b)) {
- e->read(e, &ignore, &len, 0);
+ ap_bucket_read(e, &ignore, &len, 0);
if (remain <= len) {
break;
}
}
if (e != AP_BRIGADE_SENTINEL(b)) {
if (remain <= len) {
- e->split(e, remain);
+ ap_bucket_split(e, remain);
remain = 0;
}
bb = ap_brigade_split(b, AP_BUCKET_NEXT(e));
}
AP_BRIGADE_FOREACH(e, b) {
- if ((rv = e->read(e, (const char **)&buff, &len, 0)) != APR_SUCCESS) {
+ if ((rv = ap_bucket_read(e, (const char **)&buff, &len, 0)) != APR_SUCCESS) {
return rv;
}
pos = memchr(buff, ASCII_LF, len);
if (pos != NULL) {
- e->split(e, pos - buff + 1);
+ ap_bucket_split(e, pos - buff + 1);
bb = ap_brigade_split(b, AP_BUCKET_NEXT(e));
ctx->b = bb;
return APR_SUCCESS;
ap_bucket_destroy(e);
continue;
}
- retval = e->read(e, &temp, &length, 0);
+ retval = ap_bucket_read(e, &temp, &length, 0);
if (retval != APR_SUCCESS) {
total = ((length < 0) && (total == 0)) ? -1 : total;
total = 0;
do {
- rv = b->read(b, &tempbuf, &len_read, 0);
+ rv = ap_bucket_read(b, &tempbuf, &len_read, 0);
if (len_to_read < b->length) { /* shouldn't happen */
- b->split(b, len_to_read);
+ ap_bucket_split(b, len_to_read);
}
else {
len_to_read = len_read;
API_EXPORT(apr_status_t) ap_pass_brigade(ap_filter_t *next, ap_bucket_brigade *bb)
{
if (next) {
- if (AP_BRIGADE_LAST(bb)->type == AP_BUCKET_EOS && next->r) {
+ if (AP_BRIGADE_LAST(bb)->type == ap_eos_type() && next->r) {
next->r->eos_sent = 1;
}
return next->frec->filter_func.out_func(next, bb);
}
AP_RING_FOREACH(e, &(*b)->list, ap_bucket, link) {
- if (e->setaside)
- e->setaside(e);
+ ap_bucket_setaside(e);
}
AP_BRIGADE_CONCAT(*saveto, *b);
}