You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by Dean Gaudet <dg...@hyperreal.org> on 1997/10/05 04:12:34 UTC

cvs commit: apachen/src/modules/proxy mod_proxy.c mod_proxy.h

dgaudet     97/10/04 19:12:34

  Modified:    src/modules/proxy mod_proxy.c mod_proxy.h
  Log:
  CacheDirLevels/Length must have their product < 20.
  
  PR:		1160
  Submitted by:	Lars Eilebrecht
  Reviewed by:	Dean Gaudet
  
  Revision  Changes    Path
  1.26      +10 -4     apachen/src/modules/proxy/mod_proxy.c
  
  Index: mod_proxy.c
  ===================================================================
  RCS file: /export/home/cvs/apachen/src/modules/proxy/mod_proxy.c,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- mod_proxy.c	1997/09/16 00:59:38	1.25
  +++ mod_proxy.c	1997/10/05 02:12:32	1.26
  @@ -640,8 +640,11 @@
       get_module_config(parms->server->module_config, &proxy_module);
       int val;
   
  -    if (sscanf(arg, "%d", &val) != 1)
  -	return "Value must be an integer";
  +    val = atoi(arg);
  +    if (val < 1)
  +	return "Value must be an integer greater than 0";
  +    if (val * psf->cache.dirlength > CACHEFILE_LEN)
  +	return "CacheDirLevels*CacheDirLength value must not be higher than 20";
       psf->cache.dirlevels = val;
       return NULL;
   }
  @@ -653,8 +656,11 @@
       get_module_config(parms->server->module_config, &proxy_module);
       int val;
   
  -    if (sscanf(arg, "%d", &val) != 1)
  -	return "Value must be an integer";
  +    val = atoi(arg);
  +    if (val < 1)
  +	return "Value must be an integer greater than 0";
  +    if (val * psf->cache.dirlevels > CACHEFILE_LEN)
  +	return "CacheDirLevels*CacheDirLength value must not be higher than 20";
       psf->cache.dirlength = val;
       return NULL;
   }
  
  
  
  1.24      +4 -0      apachen/src/modules/proxy/mod_proxy.h
  
  Index: mod_proxy.h
  ===================================================================
  RCS file: /export/home/cvs/apachen/src/modules/proxy/mod_proxy.h,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- mod_proxy.h	1997/09/16 00:59:39	1.23
  +++ mod_proxy.h	1997/10/05 02:12:32	1.24
  @@ -117,6 +117,10 @@
   /* number of characters in the hash */
   #define HASH_LEN (22*2)
   
  +/* maximum  'CacheDirLevels*CacheDirLength' value */
  +#define CACHEFILE_LEN 20	/* must be less than HASH_LEN/2 */
  +
  +
   #define	SEC_ONE_DAY		86400	/* one day, in seconds */
   #define	SEC_ONE_HR		3600	/* one hour, in seconds */