You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by nd...@apache.org on 2004/05/25 20:01:02 UTC

cvs commit: httpd-2.0/modules/experimental mod_cache.c

nd          2004/05/25 11:01:02

  Modified:    modules/experimental mod_cache.c
  Log:
  parse content-length correctly using new apr_strtoff function
  
  Revision  Changes    Path
  1.83      +6 -2      httpd-2.0/modules/experimental/mod_cache.c
  
  Index: mod_cache.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/experimental/mod_cache.c,v
  retrieving revision 1.82
  retrieving revision 1.83
  diff -u -u -r1.82 -r1.83
  --- mod_cache.c	10 Feb 2004 17:50:43 -0000	1.82
  +++ mod_cache.c	25 May 2004 18:01:02 -0000	1.83
  @@ -597,9 +597,13 @@
           cl = apr_table_get(r->headers_out, "Content-Length");
       }
       if (cl) {
  -        size = apr_atoi64(cl);
  +        char *errp;
  +        if (apr_strtoff(&size, cl, &errp, 10) || *errp || size < 0) {
  +            cl = NULL; /* parse error, see next 'if' block */
  +        }
       }
  -    else {
  +
  +    if (!cl) {
           /* if we don't get the content-length, see if we have all the 
            * buckets and use their length to calculate the size 
            */