Changeset 857

Show
Ignore:
Timestamp:
07/23/07 00:58:32 (1 year ago)
Author:
alo
Message:

--

Files:

Legend:

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

    r856 r857  
    112007-07-22  Alvaro Lopez Ortega  <alvaro@alobbs.com> 
     2 
     3        * cherokee/handler_redir.c, cherokee/read_config_embedded.c, 
     4        cherokee/read_config_embedded.h, cherokee/plugin_loader.c, 
     5        cherokee/handler_dirlist.c, cherokee/virtual_server.c, 
     6        cherokee/win32_misc.c, cherokee/handler_common.c, 
     7        cherokee/thread.c, cherokee/buffer.c, cherokee/handler_file.c, 
     8        cherokee/main.c, cherokee/unix4win32.h, 
     9        cherokee/Makefile.embedded, cherokee/connection.c, 
     10        cherokee/server.c, cherokee/virtual_entries.c, 
     11        cherokee/reqs_list_entry.c: CHEROKEE_EMBEDDED removed. Nobody was 
     12        using it; it didn't make sense to continue maintaining 
     13        it. Besides, embedded devices are much more powerful nowadays. 
    214 
    315        * cherokee/handler.c (cherokee_handler_free): Free the handler 
  • cherokee/trunk/cherokee/buffer.c

    r855 r857  
    13591359 
    13601360 
    1361 #ifndef CHEROKEE_EMBEDDED 
    1362  
    13631361/* Encode sha1, source buffer (buf) is not touched, 
    13641362 * whereas destination buffer (encoded) is overwritten 
     
    14061404        return ret_ok; 
    14071405} 
    1408 #endif  /* ! CHEROKEE_EMBEDDED */ 
    14091406 
    14101407 
  • cherokee/trunk/cherokee/connection.c

    r855 r857  
    210210        cherokee_server_t *srv = CONN_SRV(conn); 
    211211 
    212 #ifndef CHEROKEE_EMBEDDED 
    213212        if (conn->io_entry_ref != NULL) { 
    214213                cherokee_iocache_mmap_release (srv->iocache, conn->io_entry_ref); 
    215214                conn->io_entry_ref = NULL;       
    216215        } 
    217 #endif 
    218216 
    219217        conn->timeout           = -1; 
     
    255253 
    256254        cherokee_post_mrproper (&conn->post); 
     255        cherokee_buffer_mrproper (&conn->encoder_buffer); 
    257256 
    258257        cherokee_buffer_clean (&conn->request); 
    259  
    260 #ifdef CHEROKEE_EMBEDDED 
    261         cherokee_buffer_mrproper (&conn->request_original); 
    262 #else 
    263258        cherokee_buffer_clean (&conn->request_original); 
    264 #endif 
    265         cherokee_buffer_mrproper (&conn->encoder_buffer); 
    266259 
    267260        cherokee_buffer_clean (&conn->pathinfo); 
     
    391384         */ 
    392385        if (conn->io_entry_ref != NULL) { 
    393 #ifndef CHEROKEE_EMBEDDED 
    394386                cherokee_iocache_mmap_release (srv->iocache, conn->io_entry_ref); 
    395 #endif 
    396387        } 
    397388 
     
    16221613        /* Look in the extension table 
    16231614         */ 
    1624 #ifndef CHEROKEE_EMBEDDED 
    16251615        ret = cherokee_reqs_list_get (reqs, &conn->request, config_entry, conn); 
    16261616        switch (ret) { 
     
    16431633 
    16441634        return ret; 
    1645 #else 
    1646         return ret_ok; 
    1647 #endif 
    16481635} 
    16491636 
  • cherokee/trunk/cherokee/handler_common.c

    r834 r857  
    4848#define ENTRIES "handler,common" 
    4949 
    50 #ifdef CHEROKEE_EMBEDDED 
    51 # define cherokee_iocache_mmap_release(iocache,file) 
    52 #endif 
    53  
    5450 
    5551ret_t 
     
    106102        /* I/O cache 
    107103         */ 
    108 #ifndef CHEROKEE_EMBEDDED 
    109104        if (useit) { 
    110105                ret = cherokee_iocache_get_or_create_w_stat (iocache, path, io_entry);           
     
    128123                 
    129124        } 
    130 #endif 
    131  
    132125 
    133126        /* Without cache 
     
    177170        cherokee_buffer_add_buffer (&conn->local_directory, &conn->request); 
    178171 
    179 #ifdef CHEROKEE_EMBEDDED 
    180         use_iocache = false; 
    181 #else 
    182172        cherokee_iocache_get_default (&iocache); 
    183 #endif 
    184  
    185173        ret = stat_file (use_iocache, iocache, &nocache_info, &conn->local_directory, &file, &info); 
    186174        exists = (ret == ret_ok); 
  • cherokee/trunk/cherokee/handler_dirlist.c

    r835 r857  
    505505list_sort_by_type (cherokee_list_t *list, cherokee_dirlist_sort_t sort) 
    506506{ 
    507 #ifndef CHEROKEE_EMBEDDED 
    508507        switch (sort) { 
    509508        case Name_Down: 
     
    526525                break; 
    527526        } 
    528 #endif 
    529527} 
    530528 
     
    760758        alt = (is_dir) ? "[DIR]" : "[   ]"; 
    761759         
    762 #ifndef CHEROKEE_EMBEDDED 
    763760        if (icons != NULL) { 
    764761                if (is_dir) { 
     
    772769                } 
    773770        } 
    774 #endif 
    775771 
    776772        if (icons && (icon == NULL)) 
     
    866862         */ 
    867863        VTMP_INIT_SUBST (thread, vtmp, &props->entry); 
    868  
    869 #ifndef CHEROKEE_EMBEDDED 
    870864        if (icons != NULL) { 
    871865                icon = icons->parentdir_icon.buf; 
    872866        } 
    873 #endif 
    874867 
    875868        VTMP_SUBSTITUTE_TOKEN ("%icon%", icon); 
  • cherokee/trunk/cherokee/handler_file.c

    r834 r857  
    316316        /* I/O cache 
    317317         */ 
    318 #ifndef CHEROKEE_EMBEDDED 
    319318        if (HDL_FILE_PROP(fhdl)->use_cache) { 
    320319                ret = cherokee_iocache_get_or_create_w_stat (srv->iocache, &conn->local_directory, io_entry); 
     
    341340                return ret_error;                
    342341        } 
    343 #endif  
    344342 
    345343        /* Without cache 
     
    401399        /* Look for the mime type 
    402400         */ 
    403 #ifndef CHEROKEE_EMBEDDED 
    404401        if (srv->mime != NULL) { 
    405402                char *ext; 
     
    410407                } 
    411408        } 
    412 #endif 
    413409 
    414410        /* Is it cached on the client? 
     
    424420        /* Is this file cached in the io cache? 
    425421         */ 
    426 #ifndef CHEROKEE_EMBEDDED 
    427422        use_io = ((conn->encoder == NULL) && 
    428423                  (HDL_FILE_PROP(fhdl)->use_cache) && 
     
    454449                } 
    455450        } 
    456 #endif 
    457451 
    458452        /* Maybe open the file 
     
    573567        cherokee_buffer_add_str(buffer, CRLF); 
    574568 
    575 #ifndef CHEROKEE_EMBEDDED 
    576569        /* Add MIME related headers:  
    577570         * "Content-Type:" and "Cache-Control: max-age=" 
     
    593586                } 
    594587        } 
    595 #endif 
    596588 
    597589        /* If it's replying "304 Not Modified", we're done here 
  • cherokee/trunk/cherokee/handler_redir.c

    r625 r857  
    4444/* Methods implementation 
    4545 */ 
    46 #ifndef CHEROKEE_EMBEDDED 
    47  
    4846struct cre_list { 
    4947        cherokee_list_t    item; 
     
    258256 
    259257 
    260 #endif /* CHEROKEE_EMBEDDED */ 
    261  
    262  
    263258ret_t  
    264259cherokee_handler_redir_new (cherokee_handler_t **hdl, void *cnt, cherokee_module_props_t *props) 
     
    279274 
    280275        n->use_previous_match   = false; 
    281  
    282 #ifndef CHEROKEE_EMBEDDED 
    283276 
    284277        /* If there is an explitic redirection on the connection don't 
     
    299292                } 
    300293        } 
    301 #endif 
    302          
     294 
    303295        /* Return the new handler obj 
    304296         */ 
     
    365357        cherokee_buffer_mrproper (&props->url); 
    366358 
    367 #ifndef CHEROKEE_EMBEDDED  
    368359        list_for_each_safe (i, tmp, &props->regex_list) { 
    369360                cre_entry_free ((struct cre_list *)i); 
    370361        } 
    371 #endif 
    372362 
    373363        return cherokee_module_props_free_base (MODULE_PROPS(props)); 
     
    403393                        cherokee_buffer_add_buffer (&props->url, &subconf->val); 
    404394 
    405 #ifndef CHEROKEE_EMBEDDED 
    406395                } else if (equal_buf_str (&subconf->key, "rewrite")) { 
    407396                        cherokee_config_node_foreach (j, subconf) { 
     
    409398                                if (ret != ret_ok) return ret; 
    410399                        } 
    411 #endif 
    412400                } 
    413401        } 
  • cherokee/trunk/cherokee/main.c

    r716 r857  
    3838#define DEFAULT_CONFIG_FILE "/etc/cherokee/cherokee.conf" 
    3939 
    40 #ifndef CHEROKEE_EMBEDDED 
    4140# define GETOPT_OPT  "C:r:bhv" 
    4241# define CONFIG_FILE_HELP "[-C configfile] [-r]" 
    43 #else 
    44 # define GETOPT_OPT  "br:" 
    45 # define CONFIG_FILE_HELP "" 
    46 #endif  
    4742 
    4843#define BASIC_CONFIG                                                                         \ 
  • cherokee/trunk/cherokee/plugin_loader.c

    r852 r857  
    2929#include <string.h> 
    3030 
    31 #ifndef CHEROKEE_EMBEDDED 
    32 # ifdef HAVE_DLFCN_H 
     31#ifdef HAVE_DLFCN_H 
    3332#  include <dlfcn.h> 
    34 # endif 
    3533#endif 
    3634 
     
    4442#endif 
    4543 
    46  
    47 #ifdef CHEROKEE_EMBEDDED 
    48  
    49 ret_t 
    50 cherokee_plugin_loader_init  (cherokee_plugin_loader_t *loader) 
    51 { 
    52         return ret_ok; 
    53 } 
    54  
    55 ret_t  
    56 cherokee_plugin_loader_mrproper (cherokee_plugin_loader_t *loader) 
    57  
    58         return ret_ok;  
    59 } 
    60  
    61 ret_t  
    62 cherokee_plugin_loader_load (cherokee_plugin_loader_t *loader, char *modname) 
    63 { 
    64         extern void MODULE_INIT(common)   (cherokee_plugin_loader_t *); 
    65         extern void MODULE_INIT(file)     (cherokee_plugin_loader_t *); 
    66         extern void MODULE_INIT(redir)    (cherokee_plugin_loader_t *); 
    67         extern void MODULE_INIT(dirlist)  (cherokee_plugin_loader_t *); 
    68         extern void MODULE_INIT(cgi)      (cherokee_plugin_loader_t *); 
    69         extern void MODULE_INIT(phpcgi)   (cherokee_plugin_loader_t *); 
    70         extern void MODULE_INIT(htdigest) (cherokee_plugin_loader_t *); 
    71  
    72         if      (strcmp(modname, "common")   == 0) MODULE_INIT(common) (NULL); 
    73         else if (strcmp(modname, "file")     == 0) MODULE_INIT(file) (NULL); 
    74         else if (strcmp(modname, "redir")    == 0) MODULE_INIT(redir) (NULL); 
    75         else if (strcmp(modname, "dirlist")  == 0) MODULE_INIT(dirlist) (NULL); 
    76         else if (strcmp(modname, "cgi")      == 0) MODULE_INIT(cgi) (NULL); 
    77         else if (strcmp(modname, "phpcgi")   == 0) MODULE_INIT(phpcgi) (NULL); 
    78         else if (strcmp(modname, "htdigest") == 0) MODULE_INIT(htdigest) (NULL); 
    79         else return ret_error; 
    80  
    81         return ret_ok; 
    82 } 
    83  
    84 ret_t  
    85 cherokee_plugin_loader_unload (cherokee_plugin_loader_t *loader, char *modname) 
    86 { 
    87         return ret_ok; 
    88 } 
    89  
    90 ret_t  
    91 cherokee_plugin_loader_get_info (cherokee_plugin_loader_t *loader, char *modname, cherokee_plugin_info_t **info) 
    92 { 
    93         extern cherokee_plugin_info_t cherokee_common_info; 
    94         extern cherokee_plugin_info_t cherokee_file_info; 
    95         extern cherokee_plugin_info_t cherokee_redir_info; 
    96         extern cherokee_plugin_info_t cherokee_dirlist_info; 
    97         extern cherokee_plugin_info_t cherokee_cgi_info; 
    98         extern cherokee_plugin_info_t cherokee_phpcgi_info; 
    99         extern cherokee_plugin_info_t cherokee_htdigest_info; 
    100  
    101         if      (strcmp(modname, "common")   == 0) *info = &cherokee_common_info; 
    102         else if (strcmp(modname, "file")     == 0) *info = &cherokee_file_info; 
    103         else if (strcmp(modname, "redir")    == 0) *info = &cherokee_redir_info; 
    104         else if (strcmp(modname, "dirlist")  == 0) *info = &cherokee_dirlist_info; 
    105         else if (strcmp(modname, "cgi")      == 0) *info = &cherokee_cgi_info; 
    106         else if (strcmp(modname, "phpcgi")   == 0) *info = &cherokee_phpcgi_info; 
    107         else if (strcmp(modname, "htdigest") == 0) *info = &cherokee_htdigest_info; 
    108         else return ret_error; 
    109  
    110         return ret_ok; 
    111 } 
    112  
    113  
    114 #else  
    115  
    116  
    11744/* This is the non-embedded implementation 
    11845 */ 
    119  
    12046#include "loader.autoconf.h" 
    12147 
     
    547473 
    548474 
    549 #endif /* CHEROKEE_EMBEDDED */ 
    550  
    551  
    552475ret_t  
    553476cherokee_plugin_loader_get (cherokee_plugin_loader_t *loader, char *modname, cherokee_plugin_info_t **info) 
  • cherokee/trunk/cherokee/reqs_list_entry.c

    r597 r857  
    2727 
    2828ret_t  
    29 cherokee_reqs_list_entry_new (cherokee_reqs_list_entry_t **entry) 
     29cherokee_reqs_list_entry_new (cherokee_reqs_list_entry_t **entry) 
    3030{ 
    3131        CHEROKEE_NEW_STRUCT (n, reqs_list_entry); 
  • cherokee/trunk/cherokee/server.c

    r852 r857  
    195195        CHEROKEE_MUTEX_INIT (&n->accept_mutex, NULL); 
    196196 
    197 #ifndef CHEROKEE_EMBEDDED 
    198197        /* IO Cache cache 
    199198         */ 
     
    211210        ret = cherokee_nonce_table_new (&n->nonces); 
    212211        if (unlikely(ret < ret_ok)) return ret;  
    213 #endif 
    214212 
    215213        /* Module loader 
     
    254252        /* Config 
    255253         */ 
    256 #ifndef CHEROKEE_EMBEDDED 
    257254        cherokee_config_node_init (&n->config); 
    258 #endif 
    259255         
    260256        /* Return the object 
     
    354350        cherokee_encoder_table_mrproper (&srv->encoders); 
    355351 
    356 #ifndef CHEROKEE_EMBEDDED 
    357352        cherokee_mime_free (srv->mime); 
    358353        cherokee_icons_free (srv->icons); 
    359354        cherokee_regex_table_free (srv->regexs); 
    360355        cherokee_iocache_free_default (srv->iocache); 
    361 #endif 
    362356 
    363357        cherokee_nonce_table_free (srv->nonces); 
     
    10871081        /* Get the CPU number 
    10881082         */ 
    1089 #ifndef CHEROKEE_EMBEDDED 
    10901083        dcc_ncpus (&srv->ncpus); 
    10911084        if (srv->ncpus < 1) { 
     
    10931086                srv->ncpus = 1; 
    10941087        } 
    1095 #else 
    1096         srv->ncpus = 1; 
    1097 #endif 
    10981088 
    10991089        /* Verify the thread number and force it within sane limits. 
     
    13381328        } 
    13391329 
    1340 #ifndef CHEROKEE_EMBEDDED 
    13411330        /* Clean IO cache 
    13421331         */ 
     
    13451334                srv->iocache_clean_next = srv->bogo_now + IOCACHE_DEFAULT_CLEAN_ELAPSE; 
    13461335        } 
    1347 #endif 
    13481336 
    13491337#ifdef _WIN32 
     
    14751463        cherokee_server_t *srv = SRV(data); 
    14761464 
    1477 #ifndef CHEROKEE_EMBEDDED  
    14781465        if (srv->mime == NULL) { 
    14791466                ret = cherokee_mime_new (&srv->mime); 
     
    14891476                return ret; 
    14901477        } 
    1491 #endif 
    14921478 
    14931479        return ret_ok; 
     
    16951681        /* Icons 
    16961682         */ 
    1697 #ifndef CHEROKEE_EMBEDDED 
    16981683        TRACE (ENTRIES, "Configuring %s\n", "icons"); 
    16991684        ret = cherokee_config_node_get (&srv->config, "icons", &subconf); 
     
    17051690                if (ret != ret_ok) return ret; 
    17061691        } 
    1707 #endif  
    17081692         
    17091693        /* Load the virtual servers 
  • cherokee/trunk/cherokee/thread.c

    r852 r857  
    12241224                         */ 
    12251225                        if (conn->mmaped != NULL) { 
    1226 #ifndef CHEROKEE_EMBEDDED 
    12271226                                ret = cherokee_connection_send_header_and_mmaped (conn); 
    12281227                                switch (ret) { 
     
    12421241                                        continue; 
    12431242                                } 
    1244 #endif 
    12451243                        } 
    12461244 
  • cherokee/trunk/cherokee/unix4win32.h

    r597 r857  
    153153int         inet_aton (const char *cp, struct in_addr *addr); 
    154154 
    155 #if !defined(CHEROKEE_EMBEDDED) 
    156  
    157155/* <dlfcn.h> emulation 
    158156 */ 
     
    169167int         win_dlclose (const void *dll_handle); 
    170168const char *win_dlerror (void); 
    171  
    172 #endif  /* CHEROKEE_EMBEDDED */ 
    173  
    174169 
    175170/* Unix mmap() emulation 
  • cherokee/trunk/cherokee/virtual_entries.c

    r781 r857  
    4040                return ret; 
    4141 
    42 #ifndef CHEROKEE_EMBEDDED 
    4342        ret = cherokee_reqs_list_init (&ventry->reqs); 
    4443        if (unlikely(ret < ret_ok)) 
    4544                return ret; 
    46 #endif 
    4745 
    4846        return ret_ok; 
     
    5553        cherokee_dirs_table_mrproper (&ventry->dirs); 
    5654        cherokee_exts_table_mrproper (&ventry->exts); 
    57  
    58 #ifndef CHEROKEE_EMBEDDED 
    5955        cherokee_reqs_list_mrproper (&ventry->reqs); 
    60 #endif 
    6156 
    6257        return ret_ok; 
  • cherokee/trunk/cherokee/virtual_server.c

    r841 r857  
    605605add_request (cherokee_config_node_t *config, cherokee_virtual_server_t *vserver, cherokee_virtual_entries_t *ventry) 
    606606{ 
    607 #ifndef CHEROKEE_EMBEDDED 
    608607        ret_t                       ret; 
    609608        cherokee_reqs_list_entry_t *entry = NULL; 
     
    626625 
    627626        ret = cherokee_reqs_list_add (&ventry->reqs, entry, SRV(vserver->server_ref)->regexs); 
    628         if (ret != ret_ok) 
    629                 return ret; 
    630 #endif 
     627        if (unlikely (ret != ret_ok)) 
     628                return ret; 
    631629 
    632630        return ret_ok; 
  • cherokee/trunk/cherokee/win32_misc.c

    r790 r857  
    4949#endif 
    5050 
    51 #ifdef CHEROKEE_EMBEDDED 
    52 # define _ctor __attribute__ ((constructor)) 
    53 #else 
    54 # define _ctor 
    55 #endif 
    56  
     51#define _ctor 
    5752#define EXIT_EVENT_NAME "cherokee_exit_1" 
    5853#define CLEAR(x) memset(&(x), 0, sizeof(x)) 
     
    105100 
    106101 
    107 #if !defined(CHEROKEE_EMBEDDED) 
    108102BOOL APIENTRY DllMain (HANDLE dll_handle, DWORD reason, LPVOID reserved) 
    109103{ 
     
    115109        return (TRUE); 
    116110} 
    117 #endif 
    118111 
    119112 
     
    185178        return (ret_ok); 
    186179} 
    187  
    188  
    189 #if defined(CHEROKEE_EMBEDDED) && 0 
    190 #include "handler_phpcgi.h" 
    191  
    192  
    193 ret_t cherokee_handler_phpcgi_new (cherokee_handler_t **hdl, void *cnt, cherokee_table_t *properties) 
    194 { 
    195         SHOULDNT_HAPPEN; 
    196         return ret_error; 
    197 } 
    198  
    199  
    200 ret_t cherokee_handler_phpcgi_init (cherokee_handler_t *hdl) 
    201 { 
    202         SHOULDNT_HAPPEN; 
    203         return ret_error; 
    204 } 
    205 #endif 
    206180 
    207181 
     
    573547 
    574548 
    575 #if !defined(CHEROKEE_EMBEDDED) 
    576549/* 
    577550 * dlopen() emulation. 
     
    662635     return (win_dlerror_buf); 
    663636} 
    664  
    665 #endif  /* CHEROKEE_EMBEDDED */ 
    666637 
    667638