httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From do...@apache.org
Subject cvs commit: httpd-2.0/modules/experimental mod_case_filter_in.c
Date Mon, 20 Aug 2001 02:43:02 GMT
dougm       01/08/19 19:43:02

  Modified:    modules/experimental mod_case_filter_in.c
  Log:
  change filter name to CaseFilterIn (mod_case_filter.c already uses CaseFilter)
  allow filter to be configured without 'CaseFilterIn On'
  
  Revision  Changes    Path
  1.7       +15 -12    httpd-2.0/modules/experimental/mod_case_filter_in.c
  
  Index: mod_case_filter_in.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/experimental/mod_case_filter_in.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- mod_case_filter_in.c	2001/08/07 16:19:02	1.6
  +++ mod_case_filter_in.c	2001/08/20 02:43:02	1.7
  @@ -66,7 +66,7 @@
   
   #include <ctype.h>
   
  -static const char s_szCaseFilterName[]="CaseFilter";
  +static const char s_szCaseFilterName[]="CaseFilterIn";
   module AP_MODULE_DECLARE_DATA case_filter_in_module;
   
   typedef struct
  @@ -92,28 +92,31 @@
   {
       CaseFilterInConfig *pConfig=ap_get_module_config(r->server->module_config,
   						     &case_filter_in_module);
  -    CaseFilterInContext *pCtx;
  -
       if(!pConfig->bEnabled)
   	return;
   
  -    pCtx=apr_palloc(r->pool,sizeof *pCtx);
  -    pCtx->pbbTmp=apr_brigade_create(r->pool);
  -    ap_add_input_filter(s_szCaseFilterName,pCtx,r,NULL);
  +    ap_add_input_filter(s_szCaseFilterName,NULL,r,NULL);
   }
   
   static apr_status_t CaseFilterInFilter(ap_filter_t *f,
   				       apr_bucket_brigade *pbbOut,
   				       ap_input_mode_t eMode,apr_off_t *nBytes)
   {
  -    CaseFilterInContext *pCtx=f->ctx;
  +    request_rec *r = f->r;
  +    CaseFilterInContext *pCtx;
       apr_status_t ret;
   
  -    ap_assert(APR_BRIGADE_EMPTY(pCtx->pbbTmp));
  -    
  -    ret=ap_get_brigade(f->next,pCtx->pbbTmp,eMode,nBytes);
  -    if(eMode == AP_MODE_PEEK || ret != APR_SUCCESS)
  -	return ret;
  +    if (!(pCtx = f->ctx)) {
  +        f->ctx = pCtx = apr_palloc(r->pool, sizeof *pCtx);
  +        pCtx->pbbTmp = apr_brigade_create(r->pool);
  +    }
  +
  +    if (APR_BRIGADE_EMPTY(pCtx->pbbTmp)) {
  +        ret = ap_get_brigade(f->next,pCtx->pbbTmp,eMode,nBytes);
  +
  +        if(eMode == AP_MODE_PEEK || ret != APR_SUCCESS)
  +            return ret;
  +    }
   
       while(!APR_BRIGADE_EMPTY(pCtx->pbbTmp)) {
   	apr_bucket *pbktIn=APR_BRIGADE_FIRST(pCtx->pbbTmp);
  
  
  

Mime
View raw message