httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From i...@apache.org
Subject cvs commit: httpd-2.0/modules/test mod_bucketeer.c
Date Sat, 23 Feb 2002 19:21:18 GMT
ianh        02/02/23 11:21:18

  Modified:    modules/test mod_bucketeer.c
  Log:
  pass a brigade
  
  Revision  Changes    Path
  1.3       +12 -20    httpd-2.0/modules/test/mod_bucketeer.c
  
  Index: mod_bucketeer.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/test/mod_bucketeer.c,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- mod_bucketeer.c	23 Feb 2002 16:12:37 -0000	1.2
  +++ mod_bucketeer.c	23 Feb 2002 19:21:18 -0000	1.3
  @@ -75,6 +75,7 @@
   typedef struct bucketeer_filter_config_t
   {
       char bucketdelimter;
  +    char passdelimiter;
       char flushdelimiter;
   
   } bucketeer_filter_config_t;
  @@ -85,6 +86,7 @@
       bucketeer_filter_config_t *c = apr_pcalloc(p, sizeof *c);
   
       c->bucketdelimter = 0x02; /* ^B */
  +    c->passdelimiter = 0x10; /* ^P */
       c->flushdelimiter = 0x06; /* ^F */
   
       return c;
  @@ -121,6 +123,7 @@
           /* We're cool with filtering this. */
           ctx = f->ctx = apr_pcalloc(f->r->pool, sizeof(*ctx));
           ctx->bb = apr_brigade_create(f->r->pool); 
  +        apr_table_unset(f->r->headers_out, "Content-Length");
       }
   
       APR_BRIGADE_FOREACH(e, bb) {
  @@ -155,7 +158,7 @@
           if (len>0) {
               lastpos=0;
               for (i=0; i<len;i++) {
  -                if ( data[i] == c->flushdelimiter ) {
  +                if ( data[i] == c->flushdelimiter ||data[i] == c->bucketdelimter
|| data[i] == c->passdelimiter) {
                       apr_bucket *p;
                       if ( i-lastpos>0) {
                           p = apr_bucket_pool_create(apr_pmemdup( f->r->pool,
  @@ -166,26 +169,15 @@
                           APR_BRIGADE_INSERT_TAIL(ctx->bb,p);
                       }
                       lastpos=i+1;
  -
  -                    p = apr_bucket_flush_create();
  -                    APR_BRIGADE_INSERT_TAIL(ctx->bb,p);
  -
  -                } 
  -                else {
  -                    if (data[i] == c->bucketdelimter) {
  -                        apr_bucket *p;
  -                        if ( i-lastpos>0) {
  -                            p = apr_bucket_pool_create(apr_pmemdup( f->r->pool,
  -                                                                &data[lastpos],
  -                                                                i-lastpos),
  -                                                       i-lastpos,
  -                                                       f->r->pool);
  -
  -                            APR_BRIGADE_INSERT_TAIL(ctx->bb,p);
  -                        }
  -                        lastpos=i+1;
  +                    if ( data[i] == c->flushdelimiter) {
  +                        p = apr_bucket_flush_create();
  +                        APR_BRIGADE_INSERT_TAIL(ctx->bb,p);
  +                    }
  +                    if ( data[i] == c->flushdelimiter || data[i] == c->passdelimiter
) {
  +                        ap_pass_brigade(f->next, ctx->bb);
  +                       /* apr_brigade_cleanup(ctx->bb);*/
                       }
  -                }
  +                }                       
               }
               /* XXX: really should append this to the next 'real' bucket */
               if ( lastpos < i ) {
  
  
  

Mime
View raw message