]> granicus.if.org Git - apache/commitdiff
Stop using the index into the array for the bucket type. Now we just use
authorRyan Bloom <rbb@apache.org>
Sun, 15 Oct 2000 18:15:13 +0000 (18:15 +0000)
committerRyan Bloom <rbb@apache.org>
Sun, 15 Oct 2000 18:15:13 +0000 (18:15 +0000)
a pointer to a static structure.  The ap_foo_type functions have also been
replaced with simple macro calls.  I am going to replace the
ap_bucket_(read|split|setaside|destroy) functions with macros soon.
Reviewed by: Will Rowe

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86597 13f79535-47bb-0310-9956-ffa450edef68

modules/experimental/mod_charset_lite.c
modules/filters/mod_include.c
modules/http/http_core.c
modules/http/http_protocol.c
server/util_filter.c

index ee1b0e3b13197c188aeb0bf7ced57aef01786b9a..978ffd8f2d5cdc5376cb1fa75d38cfcd8d33be96 100644 (file)
@@ -674,7 +674,7 @@ static apr_status_t xlate_filter(ap_filter_t *f, ap_bucket_brigade *bb)
                 done = 1;
                 break;
             }
-            if (dptr->type == AP_BUCKET_EOS) {
+            if (AP_BUCKET_IS_EOS(dptr)) {
                 done = 1;
                 cur_len = AP_END_OF_BRIGADE; /* XXX yuck, but that tells us to send
                                  * eos down; when we minimize our bb construction
index 1c27509898a4d988c02826b901ee638f6cbc4a07..30dca064e310234619f595182b1a5d428d3032b0 100644 (file)
@@ -190,7 +190,7 @@ static ap_bucket *find_string(ap_bucket *dptr, const char *str, ap_bucket *end)
     int state = 0;
 
     do {
-        if (dptr->type == ap_eos_type()) {
+        if (AP_BUCKET_IS_EOS(dptr)) {
             break;
         }
         ap_bucket_read(dptr, &buf, &len, 0);
index 1eec56401a7a79b6515f1b414d9e26207ee370ce..47ebb1b4e6275169d74f922bdf67cfe80d2ece46 100644 (file)
@@ -3117,8 +3117,8 @@ static apr_status_t buffer_filter(ap_filter_t *f, ap_bucket_brigade *b)
             ap_bucket_destroy(destroy_me);
             destroy_me = NULL;
         }
-        if ((e->type == ap_eos_type())  || (e->type == ap_file_type()) ||
-            (e->type == ap_pipe_type())) {
+        if (AP_BUCKET_IS_EOS(e)  || AP_BUCKET_IS_FILE(e) ||
+            AP_BUCKET_IS_PIPE(e)) {
             pass_the_brigade = 1;
         }
         else {
@@ -3226,7 +3226,7 @@ static apr_status_t chunk_filter(ap_filter_t *f, ap_bucket_brigade *b)
         char chunk_hdr[20]; /* enough space for the snprintf below */
 
        AP_BRIGADE_FOREACH(e, b) {
-           if (e->type == ap_eos_type()) {
+           if (AP_BUCKET_IS_EOS(e)) {
                /* there shouldn't be anything after the eos */
                eos = e;
                break;
@@ -3400,10 +3400,10 @@ static int core_output_filter(ap_filter_t *f, ap_bucket_brigade *b)
         nbytes = 0; /* in case more points to another brigade */
         more = NULL;
         AP_BRIGADE_FOREACH(e, b) {
-            if (e->type == ap_eos_type()) {
+            if (AP_BUCKET_IS_EOS(e)) {
                 break;
             }
-            else if (e->type == ap_file_type()) {
+            else if (AP_BUCKET_IS_FILE(e)) {
                 ap_bucket_file *a = e->data;
                 /* Assume there is at most one AP_BUCKET_FILE in the brigade */
                 fd = a->fd;
@@ -3442,7 +3442,7 @@ static int core_output_filter(ap_filter_t *f, ap_bucket_brigade *b)
         /* 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_eos_type())) {
+        if (!fd && (!more) && (nbytes < MIN_SIZE_TO_WRITE) && !AP_BUCKET_IS_EOS(e)) {
             ap_save_brigade(f, &ctx->b, &b);
             return APR_SUCCESS;
         }
index 59d319263db13645912485e23ffac7a27ee2e99c..c813a63c4fa2b3c5da5c7232b36422c99cd90ac9 100644 (file)
@@ -890,7 +890,7 @@ apr_status_t http_filter(ap_filter_t *f, ap_bucket_brigade *b, apr_ssize_t lengt
     }
 
     e = AP_BRIGADE_FIRST(b);
-    if (f->c->remain == 0 && e->type == ap_eos_type()) {
+    if (f->c->remain == 0 && AP_BUCKET_IS_EOS(e)) {
         bb = ap_brigade_split(b, AP_BUCKET_NEXT(e));
         ctx->b = bb;
         return APR_SUCCESS;
@@ -2441,7 +2441,7 @@ API_EXPORT(long) ap_get_client_block(request_rec *r, char *buffer, int bufsiz)
                                  timeout);
             }
             b = AP_BRIGADE_FIRST(bb);
-            if (b->type == ap_eos_type()) {
+            if (AP_BUCKET_IS_EOS(b)) {
                 r->connection->remain = 0;
                 break;
             }
index 909f95dc0374ea56705cb33684f8da04c44b21f4..be4986d5140b6b30b218d2453a13c0bc66c0b3fa 100644 (file)
@@ -212,7 +212,8 @@ API_EXPORT(apr_status_t) ap_get_brigade(ap_filter_t *next,
 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_eos_type() && next->r) {
+        ap_bucket *e;
+        if ((e = AP_BRIGADE_LAST(bb)) && AP_BUCKET_IS_EOS(e) && next->r) {
             next->r->eos_sent = 1;
         }
         return next->frec->filter_func.out_func(next, bb);