httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n..@apache.org
Subject cvs commit: httpd-2.0/modules/filters mod_deflate.c
Date Sun, 18 Jul 2004 01:18:58 GMT
niq         2004/07/17 18:18:58

  Modified:    modules/filters mod_deflate.c
  Log:
  Tidy up: get rid of dubious cast (nd) and initialise encoding.
  
  Revision  Changes    Path
  1.56      +5 -4      httpd-2.0/modules/filters/mod_deflate.c
  
  Index: mod_deflate.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/filters/mod_deflate.c,v
  retrieving revision 1.55
  retrieving revision 1.56
  diff -u -r1.55 -r1.56
  --- mod_deflate.c	17 Jul 2004 15:22:35 -0000	1.55
  +++ mod_deflate.c	18 Jul 2004 01:18:58 -0000	1.56
  @@ -247,6 +247,7 @@
       apr_bucket_brigade *bb, *proc_bb;
   } deflate_ctx;
   
  +static void* const deflate_yes = (void*)"YES";
   static apr_status_t deflate_out_filter(ap_filter_t *f,
                                          apr_bucket_brigade *bb)
   {
  @@ -258,7 +259,7 @@
       int eos_only = 1;
       apr_bucket *bkt;
       char *token;
  -    const char *encoding;
  +    const char *encoding = NULL;
       deflate_filter_config *c = ap_get_module_config(r->server->module_config,
                                                       &deflate_module);
   
  @@ -389,9 +390,9 @@
            * if we get eos_only and come round again, we want to avoid redoing
            * what we've already done, so set f->ctx to a flag here
            */
  -        f->ctx = ctx = (void*)-1;
  +        f->ctx = ctx = deflate_yes;
       }
  -    if (ctx == (void*)-1) {
  +    if (ctx == deflate_yes) {
           /* deal with the pathological case of lots of empty brigades and
            * no knowledge of whether content will follow
            */
  @@ -415,7 +416,7 @@
               return ap_pass_brigade(f->next, bb);
           }
       }
  -    if (!ctx || (ctx==(void*)-1)) {
  +    if (!ctx || (ctx==deflate_yes)) {
   
           /* We're cool with filtering this. */
           ctx = f->ctx = apr_pcalloc(r->pool, sizeof(*ctx));
  
  
  

Mime
View raw message