You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by wr...@apache.org on 2001/04/10 22:28:04 UTC

cvs commit: httpd-2.0/modules/mappers mod_negotiation.c

wrowe       01/04/10 13:28:04

  Modified:    .        CHANGES
               modules/mappers mod_negotiation.c
  Log:
    Toss the float nonsense from c-l, and cast atof as a (float), which I
    will argue is a totally appropriate use of a cast :-)
  
  Revision  Changes    Path
  1.167     +3 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.166
  retrieving revision 1.167
  diff -u -r1.166 -r1.167
  --- CHANGES	2001/04/09 23:28:57	1.166
  +++ CHANGES	2001/04/10 20:27:59	1.167
  @@ -1,5 +1,8 @@
   Changes with Apache 2.0.17-dev
   
  +  *) Fix content-length in mod_negotiation to a long int representation.
  +     [William Rowe]
  +
     *) Remove BindAddress from the default config file.
        [giles@nemeton.com.au]
   
  
  
  
  1.57      +7 -8      httpd-2.0/modules/mappers/mod_negotiation.c
  
  Index: mod_negotiation.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/mappers/mod_negotiation.c,v
  retrieving revision 1.56
  retrieving revision 1.57
  diff -u -r1.56 -r1.57
  --- mod_negotiation.c	2001/02/18 02:58:52	1.56
  +++ mod_negotiation.c	2001/04/10 20:28:01	1.57
  @@ -204,7 +204,7 @@
   
       /* Now some special values */
       float level;                /* Auxiliary to content-type... */
  -    float bytes;                /* content length, if known */
  +    long  bytes;                /* content length, if known */
       int lang_index;             /* pre HTTP/1.1 language priority stuff */
       int is_pseudo_html;         /* text/html, *or* the INCLUDES_MAGIC_TYPEs */
   
  @@ -266,7 +266,7 @@
       mime_info->is_pseudo_html = 0;
       mime_info->level = 0.0f;
       mime_info->level_matched = 0.0f;
  -    mime_info->bytes = 0.0f;
  +    mime_info->bytes = 0;
       mime_info->lang_index = -1;
       mime_info->mime_stars = 0;
       mime_info->definite = 1;
  @@ -401,10 +401,10 @@
   
           if (parm[0] == 'q'
               && (parm[1] == '\0' || (parm[1] == 's' && parm[2] == '\0'))) {
  -            result->quality = atof(cp);
  +            result->quality = (float)atof(cp);
           }
           else if (parm[0] == 'l' && !strcmp(&parm[1], "evel")) {
  -            result->level = atof(cp);
  +            result->level = (float)atof(cp);
           }
           else if (!strcmp(parm, "charset")) {
               result->charset = cp;
  @@ -832,7 +832,7 @@
                   has_content = 1;
               }
               else if (!strncmp(buffer, "content-length:", 15)) {
  -                mime_info.bytes = atof(body);
  +                mime_info.bytes = atol(body);
                   has_content = 1;
               }
               else if (!strncmp(buffer, "content-language:", 17)) {
  @@ -1453,7 +1453,7 @@
    * machinery.  At some point, that ought to be fixed.
    */
   
  -static float find_content_length(negotiation_state *neg, var_rec *variant)
  +static long find_content_length(negotiation_state *neg, var_rec *variant)
   {
       apr_finfo_t statb;
   
  @@ -1463,8 +1463,7 @@
   
           if (apr_stat(&statb, fullname,
                        APR_FINFO_SIZE, neg->pool) == APR_SUCCESS) {
  -            /* Note, precision may be lost */
  -            variant->bytes = (float) statb.size;
  +            variant->bytes = statb.size;
           }
       }