Changeset 1714

Show
Ignore:
Timestamp:
08/02/08 20:09:12 (5 months ago)
Author:
alo
Message:

--

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • cherokee/trunk/ChangeLog

    r1712 r1714  
     12008-08-02  Alvaro Lopez Ortega  <alvaro@alobbs.com> 
     2 
     3        * cherokee/config_reader.c (cherokee_config_reader_parse_string): 
     4        Fixes the change about forcing the properties to be lowcase. It 
     5        was a mistake, actually. There are certain entries that should be 
     6        written in uppercase such as environment variables. This patch 
     7        removes the lower-case restriction and adds a check to ensure that 
     8        there is not entry with the case name and different case as child 
     9        of the same configuration node. Eg: vserver!001!example and 
     10        vserver!001!Example. 
     11 
    1122008-08-01  Taher Shihadeh <taher@unixwars.com> 
    213 
  • cherokee/trunk/cherokee/config_reader.c

    r1710 r1714  
    114114 
    115115 
     116static ret_t 
     117check_config_node_sanity (cherokee_config_node_t *conf) 
     118{ 
     119        cherokee_list_t *i, *j; 
     120        int              re; 
     121 
     122        /* Finds duplicate properties written in lower/upper-case 
     123         */ 
     124        cherokee_config_node_foreach (i, conf)  
     125        { 
     126                cherokee_config_node_foreach (j, conf)  
     127                { 
     128                        if (i == j) 
     129                                continue; 
     130 
     131                        re = cherokee_buffer_case_cmp_buf (&CONFIG_NODE(i)->key,  
     132                                                           &CONFIG_NODE(j)->key); 
     133                        if (re == 0) { 
     134                                PRINT_ERROR ("ERROR: '%s' and '%s' as child of the same node.\n", 
     135                                             CONFIG_NODE(i)->key.buf, CONFIG_NODE(j)->key.buf); 
     136                                return ret_error; 
     137                        } 
     138                } 
     139        } 
     140 
     141        return ret_ok; 
     142} 
     143 
     144 
    116145ret_t  
    117146cherokee_config_reader_parse_string (cherokee_config_node_t *conf, cherokee_buffer_t *buf) 
     
    169198                        while (*tmp == ' ') tmp--; 
    170199                        cherokee_buffer_add (&key, begin, (tmp + 1) - begin); 
    171                         cherokee_buffer_to_lowcase (&key); 
    172200                         
    173201                        tmp = equal + 3; 
     
    198226        cherokee_buffer_mrproper (&key); 
    199227        cherokee_buffer_mrproper (&val); 
     228 
     229        /* Sanity check 
     230         */ 
     231        ret = check_config_node_sanity (conf); 
     232        if (ret != ret_ok) 
     233                return ret; 
     234         
    200235        return ret_ok; 
    201236