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/filters mod_include.c mod_include.h
Date Sat, 23 Feb 2002 20:56:36 GMT
ianh        02/02/23 12:56:36

  Modified:    .        CHANGES
               modules/filters mod_include.c mod_include.h
  Log:
  make it work with flushes
  make the false alarm not as generic
  Reviewed by:	 Ian, Brian, Justin
  
  Revision  Changes    Path
  1.606     +2 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.605
  retrieving revision 1.606
  diff -u -r1.605 -r1.606
  --- CHANGES	23 Feb 2002 03:12:30 -0000	1.605
  +++ CHANGES	23 Feb 2002 20:56:35 -0000	1.606
  @@ -1,4 +1,6 @@
   Changes with Apache 2.0.33-dev
  +  *) mod-include: make it handle flush'es and fix the 'false-alarm'
  +     [Justin Everkrantz, Brian Pane, Ian Holsman]
   
     *) ap_get_*_filter_handle() functions to allow 3rd party modules
        to lookup filter handles so they can bypass the filter name
  
  
  
  1.190     +30 -4     httpd-2.0/modules/filters/mod_include.c
  
  Index: mod_include.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/filters/mod_include.c,v
  retrieving revision 1.189
  retrieving revision 1.190
  diff -u -r1.189 -r1.190
  --- mod_include.c	21 Feb 2002 16:18:11 -0000	1.189
  +++ mod_include.c	23 Feb 2002 20:56:35 -0000	1.190
  @@ -366,7 +366,14 @@
               break;
           }
   
  -        if (ctx->bytes_parsed >= BYTE_COUNT_THRESHOLD) {
  +        if (APR_BUCKET_IS_FLUSH(dptr)) {
  +            apr_bucket *old = dptr; 
  +            dptr = APR_BUCKET_NEXT(old);
  +            APR_BUCKET_REMOVE(old);
  +            ctx->output_now = 1;
  +            ctx->output_flush = 1;
  +        }
  +        else if (ctx->bytes_parsed >= BYTE_COUNT_THRESHOLD) {
               ctx->output_now = 1;
           }
           else if (ctx->bytes_parsed > 0) {
  @@ -430,9 +437,11 @@
               }
   
               /* False alarm... 
  -             * send out the unmatched part
                */
  -            if (ctx->parse_pos > 0) {
  +            /* send out the unmatched part
  +             */
  +             
  +            if ((ctx->parse_pos > 0) && (ctx->bytes_parsed == 0)) {
                   apr_bucket *tmp_buck;
                   tmp_buck = apr_bucket_pool_create(apr_pstrndup(ctx->pool,
                                                                  ctx->start_seq,
  @@ -441,6 +450,8 @@
                                                     ctx->pool);
                   APR_BUCKET_INSERT_BEFORE(dptr, tmp_buck);
               }
  +
  +
               ctx->state = PRE_HEAD;
           }
   
  @@ -501,6 +512,8 @@
           }
           dptr = APR_BUCKET_NEXT(dptr);
       } while (dptr != APR_BRIGADE_SENTINEL(bb));
  +          
  +  
       return NULL;
   }
   
  @@ -519,7 +532,14 @@
           if (APR_BUCKET_IS_EOS(dptr)) {
               break;
           }
  -        if (ctx->bytes_parsed >= BYTE_COUNT_THRESHOLD) {
  +        if (APR_BUCKET_IS_FLUSH(dptr)) {
  +            apr_bucket *old = dptr; 
  +            dptr = APR_BUCKET_NEXT(old);
  +            APR_BUCKET_REMOVE(old);
  +            ctx->output_now = 1;
  +            ctx->output_flush = 1;
  +        }
  +        else if (ctx->bytes_parsed >= BYTE_COUNT_THRESHOLD) {
               ctx->output_now = 1;
           }
           else if (ctx->bytes_parsed > 0) {
  @@ -2888,12 +2908,17 @@
                         (ctx->bytes_parsed >= BYTE_COUNT_THRESHOLD))) {
                   /* Send the large chunk of pre-tag bytes...  */
                   tag_and_after = apr_brigade_split(*bb, tmp_dptr);
  +                if (ctx->output_flush) {
  +                    APR_BRIGADE_INSERT_TAIL(*bb, apr_bucket_flush_create());
  +                }
  +
                   rv = ap_pass_brigade(f->next, *bb);
                   if (rv != APR_SUCCESS) {
                       return rv;
                   }
                   *bb  = tag_and_after;
                   dptr = tmp_dptr;
  +                ctx->output_flush = 0;
                   ctx->bytes_parsed = 0;
                   ctx->output_now = 0;
               }
  @@ -2936,6 +2961,7 @@
                       if (rv != APR_SUCCESS) {
                           return rv;
                       }
  +                    ctx->output_flush = 0;
                       ctx->output_now = 0;
                   }
               }
  
  
  
  1.29      +4 -0      httpd-2.0/modules/filters/mod_include.h
  
  Index: mod_include.h
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/filters/mod_include.h,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- mod_include.h	6 Jan 2002 06:41:30 -0000	1.28
  +++ mod_include.h	23 Feb 2002 20:56:36 -0000	1.29
  @@ -143,6 +143,7 @@
       int          bytes_parsed;
       apr_status_t status;
       int          output_now;
  +    int          output_flush;
       
       apr_bucket   *head_start_bucket;
       apr_size_t   head_start_index;
  @@ -206,6 +207,9 @@
       apr_bucket_brigade *tag_plus;                                 \
                                                                     \
       tag_plus = apr_brigade_split(brgd, cntxt->head_start_bucket); \
  +    if (cntxt->output_flush) {                                    \
  +        APR_BRIGADE_INSERT_TAIL(brgd, apr_bucket_flush_create()); \
  +    }                                                             \
       rc = ap_pass_brigade(next, brgd);                             \
       cntxt->bytes_parsed = 0;                                      \
       brgd = tag_plus;                                              \
  
  
  

Mime
View raw message