Changeset 857
- Timestamp:
- 07/23/07 00:58:32 (1 year ago)
- Files:
-
- cherokee/trunk/ChangeLog (modified) (1 diff)
- cherokee/trunk/cherokee/Makefile.embedded (deleted)
- cherokee/trunk/cherokee/buffer.c (modified) (2 diffs)
- cherokee/trunk/cherokee/connection.c (modified) (5 diffs)
- cherokee/trunk/cherokee/handler_common.c (modified) (4 diffs)
- cherokee/trunk/cherokee/handler_dirlist.c (modified) (5 diffs)
- cherokee/trunk/cherokee/handler_file.c (modified) (8 diffs)
- cherokee/trunk/cherokee/handler_redir.c (modified) (7 diffs)
- cherokee/trunk/cherokee/main.c (modified) (1 diff)
- cherokee/trunk/cherokee/plugin_loader.c (modified) (3 diffs)
- cherokee/trunk/cherokee/read_config_embedded.c (deleted)
- cherokee/trunk/cherokee/read_config_embedded.h (deleted)
- cherokee/trunk/cherokee/reqs_list_entry.c (modified) (1 diff)
- cherokee/trunk/cherokee/server.c (modified) (12 diffs)
- cherokee/trunk/cherokee/thread.c (modified) (2 diffs)
- cherokee/trunk/cherokee/unix4win32.h (modified) (2 diffs)
- cherokee/trunk/cherokee/virtual_entries.c (modified) (2 diffs)
- cherokee/trunk/cherokee/virtual_server.c (modified) (2 diffs)
- cherokee/trunk/cherokee/win32_misc.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
cherokee/trunk/ChangeLog
r856 r857 1 1 2007-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. 2 14 3 15 * cherokee/handler.c (cherokee_handler_free): Free the handler cherokee/trunk/cherokee/buffer.c
r855 r857 1359 1359 1360 1360 1361 #ifndef CHEROKEE_EMBEDDED1362 1363 1361 /* Encode sha1, source buffer (buf) is not touched, 1364 1362 * whereas destination buffer (encoded) is overwritten … … 1406 1404 return ret_ok; 1407 1405 } 1408 #endif /* ! CHEROKEE_EMBEDDED */1409 1406 1410 1407 cherokee/trunk/cherokee/connection.c
r855 r857 210 210 cherokee_server_t *srv = CONN_SRV(conn); 211 211 212 #ifndef CHEROKEE_EMBEDDED213 212 if (conn->io_entry_ref != NULL) { 214 213 cherokee_iocache_mmap_release (srv->iocache, conn->io_entry_ref); 215 214 conn->io_entry_ref = NULL; 216 215 } 217 #endif218 216 219 217 conn->timeout = -1; … … 255 253 256 254 cherokee_post_mrproper (&conn->post); 255 cherokee_buffer_mrproper (&conn->encoder_buffer); 257 256 258 257 cherokee_buffer_clean (&conn->request); 259 260 #ifdef CHEROKEE_EMBEDDED261 cherokee_buffer_mrproper (&conn->request_original);262 #else263 258 cherokee_buffer_clean (&conn->request_original); 264 #endif265 cherokee_buffer_mrproper (&conn->encoder_buffer);266 259 267 260 cherokee_buffer_clean (&conn->pathinfo); … … 391 384 */ 392 385 if (conn->io_entry_ref != NULL) { 393 #ifndef CHEROKEE_EMBEDDED394 386 cherokee_iocache_mmap_release (srv->iocache, conn->io_entry_ref); 395 #endif396 387 } 397 388 … … 1622 1613 /* Look in the extension table 1623 1614 */ 1624 #ifndef CHEROKEE_EMBEDDED1625 1615 ret = cherokee_reqs_list_get (reqs, &conn->request, config_entry, conn); 1626 1616 switch (ret) { … … 1643 1633 1644 1634 return ret; 1645 #else1646 return ret_ok;1647 #endif1648 1635 } 1649 1636 cherokee/trunk/cherokee/handler_common.c
r834 r857 48 48 #define ENTRIES "handler,common" 49 49 50 #ifdef CHEROKEE_EMBEDDED51 # define cherokee_iocache_mmap_release(iocache,file)52 #endif53 54 50 55 51 ret_t … … 106 102 /* I/O cache 107 103 */ 108 #ifndef CHEROKEE_EMBEDDED109 104 if (useit) { 110 105 ret = cherokee_iocache_get_or_create_w_stat (iocache, path, io_entry); … … 128 123 129 124 } 130 #endif131 132 125 133 126 /* Without cache … … 177 170 cherokee_buffer_add_buffer (&conn->local_directory, &conn->request); 178 171 179 #ifdef CHEROKEE_EMBEDDED180 use_iocache = false;181 #else182 172 cherokee_iocache_get_default (&iocache); 183 #endif184 185 173 ret = stat_file (use_iocache, iocache, &nocache_info, &conn->local_directory, &file, &info); 186 174 exists = (ret == ret_ok); cherokee/trunk/cherokee/handler_dirlist.c
r835 r857 505 505 list_sort_by_type (cherokee_list_t *list, cherokee_dirlist_sort_t sort) 506 506 { 507 #ifndef CHEROKEE_EMBEDDED508 507 switch (sort) { 509 508 case Name_Down: … … 526 525 break; 527 526 } 528 #endif529 527 } 530 528 … … 760 758 alt = (is_dir) ? "[DIR]" : "[ ]"; 761 759 762 #ifndef CHEROKEE_EMBEDDED763 760 if (icons != NULL) { 764 761 if (is_dir) { … … 772 769 } 773 770 } 774 #endif775 771 776 772 if (icons && (icon == NULL)) … … 866 862 */ 867 863 VTMP_INIT_SUBST (thread, vtmp, &props->entry); 868 869 #ifndef CHEROKEE_EMBEDDED870 864 if (icons != NULL) { 871 865 icon = icons->parentdir_icon.buf; 872 866 } 873 #endif874 867 875 868 VTMP_SUBSTITUTE_TOKEN ("%icon%", icon); cherokee/trunk/cherokee/handler_file.c
r834 r857 316 316 /* I/O cache 317 317 */ 318 #ifndef CHEROKEE_EMBEDDED319 318 if (HDL_FILE_PROP(fhdl)->use_cache) { 320 319 ret = cherokee_iocache_get_or_create_w_stat (srv->iocache, &conn->local_directory, io_entry); … … 341 340 return ret_error; 342 341 } 343 #endif344 342 345 343 /* Without cache … … 401 399 /* Look for the mime type 402 400 */ 403 #ifndef CHEROKEE_EMBEDDED404 401 if (srv->mime != NULL) { 405 402 char *ext; … … 410 407 } 411 408 } 412 #endif413 409 414 410 /* Is it cached on the client? … … 424 420 /* Is this file cached in the io cache? 425 421 */ 426 #ifndef CHEROKEE_EMBEDDED427 422 use_io = ((conn->encoder == NULL) && 428 423 (HDL_FILE_PROP(fhdl)->use_cache) && … … 454 449 } 455 450 } 456 #endif457 451 458 452 /* Maybe open the file … … 573 567 cherokee_buffer_add_str(buffer, CRLF); 574 568 575 #ifndef CHEROKEE_EMBEDDED576 569 /* Add MIME related headers: 577 570 * "Content-Type:" and "Cache-Control: max-age=" … … 593 586 } 594 587 } 595 #endif596 588 597 589 /* If it's replying "304 Not Modified", we're done here cherokee/trunk/cherokee/handler_redir.c
r625 r857 44 44 /* Methods implementation 45 45 */ 46 #ifndef CHEROKEE_EMBEDDED47 48 46 struct cre_list { 49 47 cherokee_list_t item; … … 258 256 259 257 260 #endif /* CHEROKEE_EMBEDDED */261 262 263 258 ret_t 264 259 cherokee_handler_redir_new (cherokee_handler_t **hdl, void *cnt, cherokee_module_props_t *props) … … 279 274 280 275 n->use_previous_match = false; 281 282 #ifndef CHEROKEE_EMBEDDED283 276 284 277 /* If there is an explitic redirection on the connection don't … … 299 292 } 300 293 } 301 #endif 302 294 303 295 /* Return the new handler obj 304 296 */ … … 365 357 cherokee_buffer_mrproper (&props->url); 366 358 367 #ifndef CHEROKEE_EMBEDDED368 359 list_for_each_safe (i, tmp, &props->regex_list) { 369 360 cre_entry_free ((struct cre_list *)i); 370 361 } 371 #endif372 362 373 363 return cherokee_module_props_free_base (MODULE_PROPS(props)); … … 403 393 cherokee_buffer_add_buffer (&props->url, &subconf->val); 404 394 405 #ifndef CHEROKEE_EMBEDDED406 395 } else if (equal_buf_str (&subconf->key, "rewrite")) { 407 396 cherokee_config_node_foreach (j, subconf) { … … 409 398 if (ret != ret_ok) return ret; 410 399 } 411 #endif412 400 } 413 401 } cherokee/trunk/cherokee/main.c
r716 r857 38 38 #define DEFAULT_CONFIG_FILE "/etc/cherokee/cherokee.conf" 39 39 40 #ifndef CHEROKEE_EMBEDDED41 40 # define GETOPT_OPT "C:r:bhv" 42 41 # define CONFIG_FILE_HELP "[-C configfile] [-r]" 43 #else44 # define GETOPT_OPT "br:"45 # define CONFIG_FILE_HELP ""46 #endif47 42 48 43 #define BASIC_CONFIG \ cherokee/trunk/cherokee/plugin_loader.c
r852 r857 29 29 #include <string.h> 30 30 31 #ifndef CHEROKEE_EMBEDDED 32 # ifdef HAVE_DLFCN_H 31 #ifdef HAVE_DLFCN_H 33 32 # include <dlfcn.h> 34 # endif35 33 #endif 36 34 … … 44 42 #endif 45 43 46 47 #ifdef CHEROKEE_EMBEDDED48 49 ret_t50 cherokee_plugin_loader_init (cherokee_plugin_loader_t *loader)51 {52 return ret_ok;53 }54 55 ret_t56 cherokee_plugin_loader_mrproper (cherokee_plugin_loader_t *loader)57 {58 return ret_ok;59 }60 61 ret_t62 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_t85 cherokee_plugin_loader_unload (cherokee_plugin_loader_t *loader, char *modname)86 {87 return ret_ok;88 }89 90 ret_t91 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 #else115 116 117 44 /* This is the non-embedded implementation 118 45 */ 119 120 46 #include "loader.autoconf.h" 121 47 … … 547 473 548 474 549 #endif /* CHEROKEE_EMBEDDED */550 551 552 475 ret_t 553 476 cherokee_plugin_loader_get (cherokee_plugin_loader_t *loader, char *modname, cherokee_plugin_info_t **info) cherokee/trunk/cherokee/reqs_list_entry.c
r597 r857 27 27 28 28 ret_t 29 cherokee_reqs_list_entry_new (cherokee_reqs_list_entry_t **entry)29 cherokee_reqs_list_entry_new (cherokee_reqs_list_entry_t **entry) 30 30 { 31 31 CHEROKEE_NEW_STRUCT (n, reqs_list_entry); cherokee/trunk/cherokee/server.c
r852 r857 195 195 CHEROKEE_MUTEX_INIT (&n->accept_mutex, NULL); 196 196 197 #ifndef CHEROKEE_EMBEDDED198 197 /* IO Cache cache 199 198 */ … … 211 210 ret = cherokee_nonce_table_new (&n->nonces); 212 211 if (unlikely(ret < ret_ok)) return ret; 213 #endif214 212 215 213 /* Module loader … … 254 252 /* Config 255 253 */ 256 #ifndef CHEROKEE_EMBEDDED257 254 cherokee_config_node_init (&n->config); 258 #endif259 255 260 256 /* Return the object … … 354 350 cherokee_encoder_table_mrproper (&srv->encoders); 355 351 356 #ifndef CHEROKEE_EMBEDDED357 352 cherokee_mime_free (srv->mime); 358 353 cherokee_icons_free (srv->icons); 359 354 cherokee_regex_table_free (srv->regexs); 360 355 cherokee_iocache_free_default (srv->iocache); 361 #endif362 356 363 357 cherokee_nonce_table_free (srv->nonces); … … 1087 1081 /* Get the CPU number 1088 1082 */ 1089 #ifndef CHEROKEE_EMBEDDED1090 1083 dcc_ncpus (&srv->ncpus); 1091 1084 if (srv->ncpus < 1) { … … 1093 1086 srv->ncpus = 1; 1094 1087 } 1095 #else1096 srv->ncpus = 1;1097 #endif1098 1088 1099 1089 /* Verify the thread number and force it within sane limits. … … 1338 1328 } 1339 1329 1340 #ifndef CHEROKEE_EMBEDDED1341 1330 /* Clean IO cache 1342 1331 */ … … 1345 1334 srv->iocache_clean_next = srv->bogo_now + IOCACHE_DEFAULT_CLEAN_ELAPSE; 1346 1335 } 1347 #endif1348 1336 1349 1337 #ifdef _WIN32 … … 1475 1463 cherokee_server_t *srv = SRV(data); 1476 1464 1477 #ifndef CHEROKEE_EMBEDDED1478 1465 if (srv->mime == NULL) { 1479 1466 ret = cherokee_mime_new (&srv->mime); … … 1489 1476 return ret; 1490 1477 } 1491 #endif1492 1478 1493 1479 return ret_ok; … … 1695 1681 /* Icons 1696 1682 */ 1697 #ifndef CHEROKEE_EMBEDDED1698 1683 TRACE (ENTRIES, "Configuring %s\n", "icons"); 1699 1684 ret = cherokee_config_node_get (&srv->config, "icons", &subconf); … … 1705 1690 if (ret != ret_ok) return ret; 1706 1691 } 1707 #endif1708 1692 1709 1693 /* Load the virtual servers cherokee/trunk/cherokee/thread.c
r852 r857 1224 1224 */ 1225 1225 if (conn->mmaped != NULL) { 1226 #ifndef CHEROKEE_EMBEDDED1227 1226 ret = cherokee_connection_send_header_and_mmaped (conn); 1228 1227 switch (ret) { … … 1242 1241 continue; 1243 1242 } 1244 #endif1245 1243 } 1246 1244 cherokee/trunk/cherokee/unix4win32.h
r597 r857 153 153 int inet_aton (const char *cp, struct in_addr *addr); 154 154 155 #if !defined(CHEROKEE_EMBEDDED)156 157 155 /* <dlfcn.h> emulation 158 156 */ … … 169 167 int win_dlclose (const void *dll_handle); 170 168 const char *win_dlerror (void); 171 172 #endif /* CHEROKEE_EMBEDDED */173 174 169 175 170 /* Unix mmap() emulation cherokee/trunk/cherokee/virtual_entries.c
r781 r857 40 40 return ret; 41 41 42 #ifndef CHEROKEE_EMBEDDED43 42 ret = cherokee_reqs_list_init (&ventry->reqs); 44 43 if (unlikely(ret < ret_ok)) 45 44 return ret; 46 #endif47 45 48 46 return ret_ok; … … 55 53 cherokee_dirs_table_mrproper (&ventry->dirs); 56 54 cherokee_exts_table_mrproper (&ventry->exts); 57 58 #ifndef CHEROKEE_EMBEDDED59 55 cherokee_reqs_list_mrproper (&ventry->reqs); 60 #endif61 56 62 57 return ret_ok; cherokee/trunk/cherokee/virtual_server.c
r841 r857 605 605 add_request (cherokee_config_node_t *config, cherokee_virtual_server_t *vserver, cherokee_virtual_entries_t *ventry) 606 606 { 607 #ifndef CHEROKEE_EMBEDDED608 607 ret_t ret; 609 608 cherokee_reqs_list_entry_t *entry = NULL; … … 626 625 627 626 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; 631 629 632 630 return ret_ok; cherokee/trunk/cherokee/win32_misc.c
r790 r857 49 49 #endif 50 50 51 #ifdef CHEROKEE_EMBEDDED 52 # define _ctor __attribute__ ((constructor)) 53 #else 54 # define _ctor 55 #endif 56 51 #define _ctor 57 52 #define EXIT_EVENT_NAME "cherokee_exit_1" 58 53 #define CLEAR(x) memset(&(x), 0, sizeof(x)) … … 105 100 106 101 107 #if !defined(CHEROKEE_EMBEDDED)108 102 BOOL APIENTRY DllMain (HANDLE dll_handle, DWORD reason, LPVOID reserved) 109 103 { … … 115 109 return (TRUE); 116 110 } 117 #endif118 111 119 112 … … 185 178 return (ret_ok); 186 179 } 187 188 189 #if defined(CHEROKEE_EMBEDDED) && 0190 #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 #endif206 180 207 181 … … 573 547 574 548 575 #if !defined(CHEROKEE_EMBEDDED)576 549 /* 577 550 * dlopen() emulation. … … 662 635 return (win_dlerror_buf); 663 636 } 664 665 #endif /* CHEROKEE_EMBEDDED */666 637 667 638