httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexei Kosut <ako...@hyperreal.com>
Subject cvs commit: apache/src mod_mime.c
Date Thu, 21 Mar 1996 04:20:54 GMT
akosut      96/03/20 20:20:53

  Modified:    src       mod_mime.c
  Log:
  Rewrote the filename extenstion checking code so the order is irrelevant.
  i.e. foo.html.en.gz and foo.en.gz.html will give the same headers. The old
  code would ignore the en and gz in the latter example.
  
  Another benefit is that you can, for example, do "AddLanguage en html"
  and all HTML files will be tagged as English as well as content-type
  text/html (asuming this is so defined in mime.types or an AddType).
  
  Revision  Changes    Path
  1.3       +14 -25    apache/src/mod_mime.c
  
  Index: mod_mime.c
  ===================================================================
  RCS file: /export/home/cvs/apache/src/mod_mime.c,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -C3 -r1.2 -r1.3
  *** mod_mime.c	1996/02/22 11:47:11	1.2
  --- mod_mime.c	1996/03/21 04:20:52	1.3
  ***************
  *** 203,239 ****
    	return OK;
        }
        
  !     if((i=rind(fn,'.')) < 0) return DECLINED;
  !     ++i;
    
  !     if ((type = table_get (conf->encoding_types, &fn[i])))
  !     {
  !         r->content_encoding = type;
    
  ! 	/* go back to previous extension to try to use it as a language */
    	
  !         fn[i-1] = '\0';
  ! 	if((i=rind(fn,'.')) < 0) return OK;
  ! 	++i;
  !     }
  ! 
  !     if ((type = table_get (conf->language_types, &fn[i])))
  !     {
  !         r->content_language = type;
    
  ! 	/* go back to previous extension to try to use it as a type */
  ! 	
  !         fn[i-1] = '\0';
  ! 	if((i=rind(fn,'.')) < 0) return OK;
  ! 	++i;
        }
    
  -     if ((type = table_get (conf->forced_types, &fn[i]))
  - 	|| (type = table_get (hash_buckets[hash(fn[i])], &fn[i])))
  -     {
  -         r->content_type = type;
  -     }
  -     
        return OK;
    }
    
  --- 203,228 ----
    	return OK;
        }
        
  !     /* Parse filename extensions, which can be in any order */
  !     while ((i = rind (fn, '.')) >= 0) {
  !       ++i;
    
  !       /* Check for Content-Type */
  !       if ((type = table_get (conf->forced_types, &fn[i]))
  ! 	  || (type = table_get (hash_buckets[hash(fn[i])], &fn[i])))
  !         r->content_type = type;
    
  !       /* Check for Content-Language */
  !       if ((type = table_get (conf->language_types, &fn[i])))
  ! 	  r->content_language = type;
    	
  !       /* Check for Content-Encoding */
  !       if ((type = table_get (conf->encoding_types, &fn[i])))
  !           r->content_encoding = type;
    
  !       fn[i-1] = '\0';
        }
    
        return OK;
    }
    
  
  
  

Mime
View raw message