Changeset 354
- Timestamp:
- 08/25/06 00:18:35 (2 years ago)
- Files:
-
- cherokee/trunk/Makefile.am (modified) (4 diffs)
- cherokee/trunk/cherokee.conf.sample.pre (modified) (1 diff)
- cherokee/trunk/cherokee/access.c (modified) (1 diff)
- cherokee/trunk/cherokee/cherokee_logrotate.c (modified) (1 diff)
- cherokee/trunk/cherokee/config_entry.c (modified) (1 diff)
- cherokee/trunk/cherokee/config_node.c (modified) (8 diffs)
- cherokee/trunk/cherokee/exts_table.c (modified) (1 diff)
- cherokee/trunk/cherokee/fdpoll-protected.h (modified) (1 diff)
- cherokee/trunk/cherokee/fdpoll.c (modified) (1 diff)
- cherokee/trunk/cherokee/header-protected.h (modified) (1 diff)
- cherokee/trunk/cherokee/header.c (modified) (1 diff)
- cherokee/trunk/cherokee/list_ext.c (modified) (2 diffs)
- cherokee/trunk/cherokee/list_ext.h (modified) (2 diffs)
- cherokee/trunk/cherokee/pcre/pcre.c (modified) (1 diff)
- cherokee/trunk/cherokee/socket.c (modified) (6 diffs)
- cherokee/trunk/cherokee/table.c (modified) (1 diff)
- cherokee/trunk/cherokee/util.c (modified) (1 diff)
- cherokee/trunk/cherokee/virtual_server.c (modified) (1 diff)
- cherokee/trunk/icons.conf.sample (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
cherokee/trunk/Makefile.am
r353 r354 30 30 $(top_builddir)/cherokee_replace $< $@ "%sysconfdir%" "${sysconfdir}" "%datadir%" "${datadir}" "%prefix%" "${prefix}" "%wwwroot%" "${WWW_ROOT}" 31 31 32 CONFS_PRE = \32 CONFS_PRE = \ 33 33 cherokee.conf.sample.pre \ 34 34 performance.conf.sample.pre 35 35 36 CONFS_DONE = \ 37 mime.types.sample \ 36 CONFS_DONE = \ 37 mods-icons.conf.sample \ 38 mime.types.sample \ 38 39 mime.compression.types.sample 39 40 … … 83 84 @$(mkinstalldirs) $(DESTDIR)$(cherokeeconfdir) 84 85 @$(mkinstalldirs) $(DESTDIR)$(cherokeeconfdir)/ssl 86 @$(mkinstalldirs) $(DESTDIR)$(cherokeeconfdir)/mods-available 87 @$(mkinstalldirs) $(DESTDIR)$(cherokeeconfdir)/mods-enabled 88 @$(mkinstalldirs) $(DESTDIR)$(cherokeeconfdir)/sites-available 89 @$(mkinstalldirs) $(DESTDIR)$(cherokeeconfdir)/sites-enabled 85 90 @if test -f $(DESTDIR)$(cherokeeconfdir)/cherokee.conf ; then \ 86 91 echo "$@ will not overwrite existing $(DESTDIR)$(cherokeeconfdir)/cherokee.conf"; \ … … 105 110 @if test -d $(DESTDIR)$(sysconfdir)/pam.d && test ! -d $(DESTDIR)$(sysconfdir)/pam.d/cherokee ; then \ 106 111 $(INSTALL_DATA) $(top_srcdir)/pam.d_cherokee $(DESTDIR)$(sysconfdir)/pam.d/cherokee; \ 112 fi 113 @if test -f $(DESTDIR)$(cherokeeconfdir)/mods-available/icons ; then \ 114 echo "$@ will not overwrite existing $(DESTDIR)$(cherokeeconfdir)/mods-available/icons"; \ 115 else \ 116 $(INSTALL_DATA) $(top_builddir)/icons.conf.sample $(DESTDIR)$(cherokeeconfdir)/mods-available/icons; \ 117 $(SHELL) -c "cd $(DESTDIR)$(cherokeeconfdir)/mods-enabled/ && $(LN_S) ../mods-available/icons ."; \ 107 118 fi 108 119 @if test -f $(DESTDIR)$(cherokeeconfdir)/mods-available/ssl ; then \ … … 131 142 fi 132 143 @if test -f $(DESTDIR)$(cherokeeconfdir)/mods-available/ssl ; then \ 144 echo "rm -f $(cherokeeconfdir)/mods-available/ssl"; \ 133 145 $(RM) -f $(DESTDIR)$(cherokeeconfdir)/mods-available/ssl; \ 146 fi 147 @if test -f $(DESTDIR)$(cherokeeconfdir)/mods-available/icons ; then \ 148 echo "rm -f $(cherokeeconfdir)/mods-available/icons"; \ 149 $(RM) -f $(DESTDIR)$(cherokeeconfdir)/mods-available/icons; \ 134 150 fi 135 151 cherokee/trunk/cherokee.conf.sample.pre
r343 r354 51 51 vserver!default!extensions!php!priority = 99999 52 52 53 # Icons 54 # 55 icons!default = unknown.png 56 icons!directory = folder.png 57 icons!parent_directory = back.png 53 include = %sysconfdir%/cherokee/mods-enabled 54 include = %sysconfdir%/cherokee/sites-enabled 58 55 59 icons!file!core = core60 icons!file!*README* = readme.png61 62 icons!suffix!text.png = txt,text63 icons!suffix!image.png = jpg,jpeg,jpe,png,gif,xcf,bmp,pcx,tiff,tif,cdr,psd,xpm,xbm64 icons!suffix!sound.png = au,snd,mid,midi,kar,mpga,mpega,mp2,mp3,m3u,sid,wav,aif,aiff,aifc,gsm,m3u,wma,wax,ra,rm,ram,pls,sd2,ogg65 icons!suffix!movie.png = avi,ogg66 icons!suffix!compressed.png = tar,gz,bz2,zip,rar,ace,lha,Z67 icons!suffix!binary.png = bin,exe,com,msi68 icons!suffix!script.png = sh,csh,ksh,tcl,tk,py,pl,php69 icons!suffix!tex.png = tex,latex,ltx,sty,cls70 icons!suffix!ps.png = ps,eps,ai71 icons!suffix!pdf.png = pdf72 icons!suffix!iso.png = iso,ngr,cue73 icons!suffix!java.png = java,class,jarcherokee/trunk/cherokee/access.c
r269 r354 434 434 sep = *slash; 435 435 *slash = '\0'; 436 ret urncherokee_access_add_ip (entry, ip_or_subnet);436 ret = cherokee_access_add_ip (entry, ip_or_subnet); 437 437 *slash = sep; 438 438 return ret; cherokee/trunk/cherokee/cherokee_logrotate.c
r122 r354 24 24 25 25 #include <cherokee/cherokee.h> 26 27 #ifdef HAVE_CONFIG_H 28 # include <config.h> 29 #endif 26 30 27 31 #include <string.h> cherokee/trunk/cherokee/config_entry.c
r336 r354 129 129 } 130 130 131 entry->handler_new_func = modinfo->new_func;131 entry->handler_new_func = (handler_func_new_t) modinfo->new_func; 132 132 entry->handler_methods = MODULE_INFO_HANDLER(modinfo)->valid_methods; 133 133 cherokee/trunk/cherokee/config_node.c
r283 r354 24 24 25 25 #include "common-internal.h" 26 27 #include <sys/types.h> 28 #include <sys/stat.h> 29 #include <unistd.h> 30 26 31 #include "config_node.h" 27 32 #include "util.h" … … 111 116 return n; 112 117 } 118 119 120 static ret_t 121 do_include (cherokee_config_node_t *conf, cherokee_buffer_t *path) 122 { 123 int re; 124 struct stat info; 125 126 re = stat (path->buf, &info); 127 if (re < 0) { 128 PRINT_MSG ("Could not access '%s'\n", path->buf); 129 return ret_error; 130 } 131 132 if (S_ISREG(info.st_mode)) { 133 return cherokee_config_node_parse_file (conf, path->buf); 134 135 } else if (S_ISDIR(info.st_mode)) { 136 DIR *dir; 137 struct dirent *entry; 138 int entry_len; 139 140 dir = opendir (path->buf); 141 if (dir == NULL) return ret_error; 142 143 while ((entry = readdir(dir)) != NULL) { 144 ret_t ret; 145 cherokee_buffer_t full_new = CHEROKEE_BUF_INIT; 146 147 /* Ignore backup files 148 */ 149 entry_len = strlen(entry->d_name); 150 151 if ((entry->d_name[0] == '.') || 152 (entry->d_name[0] == '#') || 153 (entry->d_name[entry_len-1] == '~')) 154 { 155 continue; 156 } 157 158 ret = cherokee_buffer_add_va (&full_new, "%s/%s", path->buf, entry->d_name); 159 if (unlikely (ret != ret_ok)) return ret; 160 161 ret = cherokee_config_node_parse_file (conf, full_new.buf); 162 if (ret != ret_ok) { 163 cherokee_buffer_mrproper (&full_new); 164 return ret; 165 } 166 167 cherokee_buffer_mrproper (&full_new); 168 } 169 170 closedir (dir); 171 return ret_ok; 172 } 173 174 SHOULDNT_HAPPEN; 175 return ret_error; 176 } 177 113 178 114 179 ret_t … … 121 186 cherokee_buffer_t tmp = CHEROKEE_BUF_INIT; 122 187 cherokee_boolean_t final = false; 188 189 /* 'include' is a special case 190 */ 191 if (equal_str (key, "include")) { 192 return do_include (conf, val); 193 } 123 194 124 195 do { … … 157 228 } 158 229 230 159 231 ret_t 160 232 cherokee_config_node_add_buf (cherokee_config_node_t *conf, cherokee_buffer_t *key, cherokee_buffer_t *val) … … 162 234 return cherokee_config_node_add (conf, key->buf, val); 163 235 } 236 164 237 165 238 ret_t … … 208 281 return ret_ok; 209 282 } 283 210 284 211 285 ret_t … … 311 385 } 312 386 387 313 388 ret_t 314 389 cherokee_config_node_parse_file (cherokee_config_node_t *conf, const char *file) … … 428 503 } 429 504 505 430 506 ret_t 431 507 cherokee_config_node_convert_list (cherokee_config_node_t *conf, const char *key, list_t *list) cherokee/trunk/cherokee/exts_table.c
r295 r354 54 54 cherokee_exts_table_free (cherokee_exts_table_t *et) 55 55 { 56 cherokee_list_free (&et->list, ( void *)cherokee_config_entry_free);56 cherokee_list_free (&et->list, (cherokee_list_free_func) cherokee_config_entry_free); 57 57 cherokee_table_mrproper (&et->table); 58 58 cherokee/trunk/cherokee/fdpoll-protected.h
r178 r354 40 40 ret_t fdpoll_epoll_new (cherokee_fdpoll_t **fdp, int sys_limit, int limit); 41 41 ret_t fdpoll_kqueue_new (cherokee_fdpoll_t **fdp, int sys_limit, int limit); 42 ret_t fdpoll_port_new (cherokee_fdpoll_t **fdp, int sys_limit, int limit); 42 43 ret_t fdpoll_poll_new (cherokee_fdpoll_t **fdp, int sys_limit, int limit); 43 44 ret_t fdpoll_select_new (cherokee_fdpoll_t **fdp, int sys_limit, int limit); cherokee/trunk/cherokee/fdpoll.c
r178 r354 26 26 #include "fdpoll-protected.h" 27 27 28 28 29 ret_t 29 30 cherokee_fdpoll_new (cherokee_fdpoll_t **fdp, cherokee_poll_type_t type, int sys_limit, int limit) cherokee/trunk/cherokee/header-protected.h
r343 r354 81 81 82 82 #define HDR_METHOD(h) (HDR(h)->method) 83 #define HDR_VERSION(h) (HDR(h)->version) 83 84 #define HDR_RESPONSE(h) (HDR(h)->response) 84 85 cherokee/trunk/cherokee/header.c
r351 r354 877 877 cuint_t len; 878 878 879 ret = cherokee_http_version_to_string (HDR_ METHOD(hdr), &tmp, &len);879 ret = cherokee_http_version_to_string (HDR_VERSION(hdr), &tmp, &len); 880 880 if (unlikely(ret != ret_ok)) return ret; 881 881 cherokee/trunk/cherokee/list_ext.c
r269 r354 64 64 65 65 ret_t 66 cherokee_list_free (list_t *head, void (*free_func) (void *))66 cherokee_list_free (list_t *head, cherokee_list_free_func free_func) 67 67 { 68 68 list_t *i, *tmp; … … 79 79 80 80 ret_t 81 cherokee_list_free_item (list_t *head, void (*free_func) (void *))81 cherokee_list_free_item (list_t *head, cherokee_list_free_func free_func) 82 82 { 83 83 list_del (head); cherokee/trunk/cherokee/list_ext.h
r269 r354 29 29 #include "list.h" 30 30 31 typedef void (*cherokee_list_free_func) (void *); 32 31 33 typedef struct { 32 34 list_t list; … … 41 43 ret_t cherokee_list_add_tail (list_t *head, void *item); 42 44 43 ret_t cherokee_list_free (list_t *head, void (*free_func) (void *));44 ret_t cherokee_list_free_item (list_t *head, void (*free_func) (void *));45 ret_t cherokee_list_free (list_t *head, cherokee_list_free_func free_func); 46 ret_t cherokee_list_free_item (list_t *head, cherokee_list_free_func free_func); 45 47 ret_t cherokee_list_free_item_simple (list_t *head); 46 48 cherokee/trunk/cherokee/pcre/pcre.c
r343 r354 5567 5567 5568 5568 const uschar *callpat; /* Many of these variables are used ony */ 5569 // const uschar *charptr; /* small blocks of the code. My normal */5570 5569 const uschar *data; /* style of coding would have declared */ 5571 // const uschar *lastptr; /* them within each of those blocks. */5572 5570 const uschar *next; /* However, in order to accommodate the */ 5573 5571 const uschar *pp; /* version of this code that uses an */ cherokee/trunk/cherokee/socket.c
r333 r354 209 209 db_retrieve (void *ptr, gnutls_datum key) 210 210 { 211 ret_t ret;212 cherokee_table_t *cache;213 gnutls_datum new = { NULL, 0 };214 cherokee_socket_t *socket = SOCKET(ptr);211 ret_t ret; 212 cherokee_table_t *cache; 213 gnutls_datum new = { NULL, 0 }; 214 cherokee_socket_t *socket = SOCKET(ptr); 215 215 216 216 // printf ("db::retrieve\n"); … … 225 225 /* Get (and remove) the object from the session cache 226 226 */ 227 ret = cherokee_table_del (cache, key.data, (void **)&new);227 ret = cherokee_table_del (cache, (char *)key.data, (void **)&new); 228 228 if (ret != ret_ok) return new; 229 229 … … 234 234 db_remove (void *ptr, gnutls_datum key) 235 235 { 236 ret_t ret;237 cherokee_table_t *cache;238 gnutls_datum *n = NULL;239 cherokee_socket_t *socket = SOCKET(ptr);236 ret_t ret; 237 cherokee_table_t *cache; 238 gnutls_datum *n = NULL; 239 cherokee_socket_t *socket = SOCKET(ptr); 240 240 241 241 // printf ("db::remove\n"); … … 249 249 // ret = cherokee_session_cache_del (cache, key.data, key.size); 250 250 251 ret = cherokee_table_del (cache, key.data, NULL);251 ret = cherokee_table_del (cache, (char *)key.data, NULL); 252 252 if (n != NULL) 253 253 free (n); … … 259 259 db_store (void *ptr, gnutls_datum key, gnutls_datum data) 260 260 { 261 ret_t ret;262 gnutls_datum *n;263 cherokee_table_t *cache;264 cherokee_socket_t *socket = SOCKET(ptr);261 ret_t ret; 262 gnutls_datum *n; 263 cherokee_table_t *cache; 264 cherokee_socket_t *socket = SOCKET(ptr); 265 265 // printf ("db::store\n"); 266 266 … … 279 279 // ret = cherokee_session_cache_add (cache, key.data, key.size, data.data, data.size); 280 280 // cherokee_session_cache_add (cache, key 281 ret = cherokee_table_add (cache, key.data, n);281 ret = cherokee_table_add (cache, (char *)key.data, n); 282 282 283 283 return (ret == ret_ok) ? 0 : 1; cherokee/trunk/cherokee/table.c
r283 r354 204 204 int re; 205 205 206 re = avl_iterate_inorder (tab, foreach_wrapper, func, NULL, NULL);206 re = avl_iterate_inorder (tab, foreach_wrapper, (void *)func, NULL, NULL); 207 207 if (unlikely (re != 0)) return ret_error; 208 208 cherokee/trunk/cherokee/util.c
r333 r354 596 596 goto number; 597 597 case 'f': 598 ul = va_arg(ap, double); / / FIXME: Add float numbers support598 ul = va_arg(ap, double); /* FIXME: Add float numbers support */ 599 599 len += 30; 600 600 base = 10; 601 601 goto number; 602 602 case 'p': 603 len += 2; /* Pointer: "0x" + hex value */603 len += 2; /* Pointer: "0x" + hex value */ 604 604 case 'x': 605 605 ul = lflag ? va_arg(ap, culong_t) : va_arg(ap, int); cherokee/trunk/cherokee/virtual_server.c
r343 r354 401 401 402 402 if (info->configure) { 403 ret = info->configure (subconf, vserver->server_ref, &entry->handler_properties);403 ret = info->configure (subconf, vserver->server_ref, (void **) &entry->handler_properties); 404 404 if (ret != ret_ok) return ret; 405 405 } cherokee/trunk/icons.conf.sample
r31 r354 1 # Icons 1 2 # 2 # File: Special files 3 # 4 file { 5 readme.png *README* 6 bomb.png core 7 } 3 icons!default = unknown.png 4 icons!directory = folder.png 5 icons!parent_directory = back.png 8 6 9 # 10 # Suffix: File extensions to Icons 11 # 12 suffix { 13 text.png txt, text 14 image.png jpg, jpeg, jpe, png, gif, xcf, bmp, pcx, tiff, tif, cdr, psd, xpm, xbm 15 sound.png au, snd, mid, midi, kar, mpga, mpega, mp2, mp3, m3u, sid, wav, aif, aiff, aifc, gsm, m3u, wma, wax, ra, rm, ram, pls, sd2, ogg 16 movie.png avi, ogg 17 compressed.png tar, gz, bz2, zip, rar, ace, lha, Z 18 binary.png bin, exe, com, msi 19 script.png sh, csh, ksh, tcl, tk, py, pl, php 20 tex.png tex, latex, ltx, sty, cls 21 ps.png ps, eps, ai 22 pdf.png pdf 23 iso.png iso, nrg, cue 24 java.png java, class, jar 25 } 7 icons!file!core = core 8 icons!file!*README* = readme.png 26 9 27 # 28 # Directory: Icon for directories 29 # 30 Directory folder.png 31 32 # 33 # ParentDirectory: Parent Directory icon 34 # 35 ParentDirectory back.png 36 37 # 38 # Default: Icon for the rest 39 # 40 Default unknown.png 10 icons!suffix!text.png = txt,text 11 icons!suffix!image.png = jpg,jpeg,jpe,png,gif,xcf,bmp,pcx,tiff,tif,cdr,psd,xpm,xbm 12 icons!suffix!sound.png = au,snd,mid,midi,kar,mpga,mpega,mp2,mp3,m3u,sid,wav,aif,aiff,aifc,gsm,m3u,wma,wax,ra,rm,ram,pls,sd2,ogg 13 icons!suffix!movie.png = avi,ogg 14 icons!suffix!compressed.png = tar,gz,bz2,zip,rar,ace,lha,Z 15 icons!suffix!binary.png = bin,exe,com,msi 16 icons!suffix!script.png = sh,csh,ksh,tcl,tk,py,pl,php 17 icons!suffix!tex.png = tex,latex,ltx,sty,cls 18 icons!suffix!ps.png = ps,eps,ai 19 icons!suffix!pdf.png = pdf 20 icons!suffix!iso.png = iso,ngr,cue 21 icons!suffix!java.png = java,class,jar