Changeset 268

Show
Ignore:
Timestamp:
04/15/06 21:27:49 (3 years ago)
Author:
alo
Message:

--

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • cherokee/branches/0.5/ChangeLog

    r267 r268  
    112006-04-15  Alvaro Lopez Ortega  <alvaro@alobbs.com> 
     2 
     3        * cherokee/read_config_grammar.y, cherokee/server-protected.h, 
     4        cherokee/module_read_config.c, cherokee/server.c: It was failing 
     5        to load more than one MimeFile. 
    26 
    37        * cherokee/handler_dirlist.c (cherokee_handler_dirlist_add_headers): 
  • cherokee/branches/0.5/cherokee/module_read_config.c

    r173 r268  
    255255                } 
    256256        } 
    257  
    258         /* Maybe read the MIME file 
    259          */ 
    260         if (srv->mime_file != NULL) { 
    261                 if (srv->mime == NULL) { 
    262                         ret = cherokee_mime_new (&srv->mime); 
    263                         if (ret < ret_ok) { 
    264                                 PRINT_ERROR_S ("Can not get default MIME configuration file\n"); 
    265                                 return ret; 
    266                         } 
    267                 } 
    268  
    269                 ret = cherokee_mime_load_mime_types (srv->mime, srv->mime_file); 
    270                 if (ret < ret_ok) { 
    271                         PRINT_ERROR ("Can not load MIME configuration file %s\n", srv->mime_file); 
    272                         return ret; 
    273                 } 
    274         } 
    275257#endif 
    276258 
  • cherokee/branches/0.5/cherokee/read_config_grammar.y

    r228 r268  
    768768mime : T_MIME_FILE fulldir 
    769769{ 
    770            SRV(server)->mime_file = $2; 
     770           ret_t ret; 
     771 
     772           if (SRV(server)->mime == NULL) { 
     773                         ret = cherokee_mime_new (&SRV(server)->mime); 
     774                         if (ret != ret_ok) { 
     775                                    PRINT_ERROR_S ("Can not get default MIME configuration file\n"); 
     776                                    return 1; 
     777                         } 
     778           } 
     779 
     780           ret = cherokee_mime_load_mime_types (SRV(server)->mime, $2); 
     781           if (ret < ret_ok) { 
     782                         PRINT_ERROR ("Can not load MIME configuration file %s\n", $2); 
     783                         return 1; 
     784           } 
    771785}; 
    772786 
  • cherokee/branches/0.5/cherokee/server-protected.h

    r166 r268  
    154154        /* Mime 
    155155         */ 
    156         char                      *mime_file; 
    157156        cherokee_mime_t           *mime; 
    158157 
  • cherokee/branches/0.5/cherokee/server.c

    r187 r268  
    117117        /* Mime types 
    118118         */ 
    119         n->mime_file       = NULL; 
    120119        n->mime            = NULL; 
    121120 
     
    319318        /* Mime 
    320319         */ 
    321         if (srv->mime_file != NULL) { 
    322                 free (srv->mime_file); 
    323                 srv->mime_file = NULL; 
    324         } 
    325  
    326320        if (srv->mime != NULL) { 
    327321                cherokee_mime_free (srv->mime);