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/include util_filter.h
Date Thu, 28 Oct 2004 13:21:08 GMT
niq         2004/10/28 06:21:08

  Modified:    modules/experimental mod_filter.c
               include  util_filter.h
  Log:
  Fixup broken handling of range header.
  
  Revision  Changes    Path
  1.22      +13 -3     httpd-2.0/modules/experimental/mod_filter.c
  
  Index: mod_filter.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/experimental/mod_filter.c,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- mod_filter.c	27 Oct 2004 10:46:26 -0000	1.21
  +++ mod_filter.c	28 Oct 2004 13:21:08 -0000	1.22
  @@ -100,6 +100,10 @@
       mod_filter_chain *chain;
   } mod_filter_cfg;
   
  +typedef struct {
  +    const char* range ;
  +} mod_filter_ctx ;
  +
   
   static void filter_trace(apr_pool_t *pool, int debug, const char *fname,
                            apr_bucket_brigade *bb)
  @@ -164,6 +168,8 @@
       request_rec *r = f->r;
       harness_ctx *ctx = f->ctx;
       provider_ctx *pctx;
  +    mod_filter_ctx *rctx = ap_get_module_config(r->request_config,
  +                                                &filter_module);
   
       /* Check registered providers in order */
       for (provider = filter->providers; provider; provider = provider->next) {
  @@ -307,8 +313,10 @@
               if (proto_flags & AP_FILTER_PROTO_NO_BYTERANGE) {
                   apr_table_unset(r->headers_out, "Accept-Ranges");
               }
  -            else if (filter->range) {
  -                apr_table_setn(r->headers_in, "Range", filter->range);
  +            else if (rctx && rctx->range) {
  +                /* restore range header we saved earlier */
  +                apr_table_setn(r->headers_in, "Range", rctx->range);
  +                rctx->range = NULL;
               }
   #endif
               for (pctx = ctx->init_ctx; pctx; pctx = pctx->next) {
  @@ -709,6 +717,8 @@
                                                  &filter_module);
   #ifndef NO_PROTOCOL
       int ranges = 1;
  +    mod_filter_ctx *ctx = apr_pcalloc(r->pool, sizeof(mod_filter_ctx));
  +    ap_set_module_config(r->request_config, &filter_module, ctx);
   #endif
   
       for (p = cfg->chain; p; p = p->next) {
  @@ -718,7 +728,7 @@
           if (ranges && (filter->proto_flags
                          & (AP_FILTER_PROTO_NO_BYTERANGE
                             | AP_FILTER_PROTO_CHANGE_LENGTH))) {
  -            filter->range = apr_table_get(r->headers_in, "Range");
  +            ctx->range = apr_table_get(r->headers_in, "Range");
               apr_table_unset(r->headers_in, "Range");
               ranges = 0;
           }
  
  
  
  1.91      +0 -3      httpd-2.0/include/util_filter.h
  
  Index: util_filter.h
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/include/util_filter.h,v
  retrieving revision 1.90
  retrieving revision 1.91
  diff -u -r1.90 -r1.91
  --- util_filter.h	27 Oct 2004 09:20:33 -0000	1.90
  +++ util_filter.h	28 Oct 2004 13:21:08 -0000	1.91
  @@ -256,9 +256,6 @@
   
       /** Protocol flags for this filter */
       unsigned int proto_flags;
  -
  -    /** Save Ranges header if this filter unsets it */
  -    const char* range;
   };
   
   /**
  
  
  

Mime
View raw message