Changeset 3113
- Timestamp:
- 08/19/08 23:34:16 (2 years ago)
- Location:
- trunk/varnish-cache
- Files:
-
- 2 added
- 8 modified
-
bin/varnishd/Makefile.am (modified) (5 diffs)
-
bin/varnishd/cache_acceptor.c (modified) (2 diffs)
-
bin/varnishd/cache_acceptor.h (modified) (1 diff)
-
bin/varnishd/cache_acceptor_poll.c (modified) (2 diffs)
-
bin/varnishd/cache_acceptor_ports.c (added)
-
bin/varnishd/cache_pool.c (modified) (2 diffs)
-
bin/varnishd/storage_umem.c (added)
-
bin/varnishd/tcp.c (modified) (1 diff)
-
bin/varnishd/varnishd.c (modified) (2 diffs)
-
configure.ac (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/varnish-cache/bin/varnishd/Makefile.am
r3089 r3113 10 10 cache_acceptor.c \ 11 11 cache_acceptor_epoll.c \ 12 cache_acceptor_kqueue.c \ 12 13 cache_acceptor_poll.c \ 13 cache_acceptor_ kqueue.c \14 cache_acceptor_ports.c \ 14 15 cache_backend.c \ 15 16 cache_backend_cfg.c \ … … 28 29 cache_main.c \ 29 30 cache_panic.c \ 31 cache_pipe.c \ 30 32 cache_pool.c \ 31 cache_pipe.c \32 33 cache_response.c \ 33 34 cache_session.c \ … … 36 37 cache_vrt.c \ 37 38 cache_vrt_acl.c \ 39 cache_vrt_esi.c \ 38 40 cache_vrt_re.c \ 39 cache_vrt_esi.c \40 41 cache_ws.c \ 42 hash_classic.c \ 41 43 hash_simple_list.c \ 42 hash_classic.c \43 44 instance.c \ 44 45 mgt_child.c \ … … 52 53 storage_malloc.c \ 53 54 storage_synth.c \ 55 storage_umem.c \ 54 56 tcp.c \ 55 57 varnishd.c … … 58 60 acct_fields.h \ 59 61 cache.h \ 62 cache_acceptor.h \ 60 63 cache_backend.h \ 61 64 cache_backend_poll.h \ 62 cache_acceptor.h \63 65 common.h \ 64 66 default_vcl.h \ -
trunk/varnish-cache/bin/varnishd/cache_acceptor.c
r3072 r3113 47 47 #include <sys/socket.h> 48 48 49 #include "config.h"50 49 #include "cli.h" 51 50 #include "cli_priv.h" … … 61 60 &acceptor_epoll, 62 61 #endif 63 #if defined(HAVE_POLL) 62 #if defined(HAVE_PORT_CREATE) 63 &acceptor_ports, 64 #endif 64 65 &acceptor_poll, 65 #endif66 66 NULL, 67 67 }; -
trunk/varnish-cache/bin/varnishd/cache_acceptor.h
r2632 r3113 49 49 #endif 50 50 51 #if defined(HAVE_POLL)52 51 extern struct acceptor acceptor_poll; 52 53 #if defined(HAVE_PORT_CREATE) 54 extern struct acceptor acceptor_ports; 53 55 #endif 54 56 -
trunk/varnish-cache/bin/varnishd/cache_acceptor_poll.c
r2972 r3113 32 32 33 33 #include "config.h" 34 35 #if defined(HAVE_POLL)36 34 37 35 #include <stdio.h> … … 168 166 .init = vca_poll_init, 169 167 }; 170 171 #endif /* defined(HAVE_POLL) */ -
trunk/varnish-cache/bin/varnishd/cache_pool.c
r3079 r3113 52 52 #include <sys/socket.h> 53 53 #elif defined(__linux__) 54 #include <sys/sendfile.h> 55 #elif defined(__sun) 54 56 #include <sys/sendfile.h> 55 57 #else … … 192 194 w->werr++; 193 195 } while (0); 196 #elif defined(__sun) 197 #ifdef HAVE_SENDFILEV 198 do { 199 sendfilevec_t svvec[HTTP_HDR_MAX * 2 + 1]; 200 size_t xferred = 0, expected = 0; 201 int i; 202 for (i = 0; i < w->niov; i++) { 203 svvec[i].sfv_fd = SFV_FD_SELF; 204 svvec[i].sfv_flag = 0; 205 svvec[i].sfv_off = (off_t) w->iov[i].iov_base; 206 svvec[i].sfv_len = w->iov[i].iov_len; 207 expected += svvec[i].sfv_len; 208 } 209 svvec[i].sfv_fd = fd; 210 svvec[i].sfv_flag = 0; 211 svvec[i].sfv_off = off; 212 svvec[i].sfv_len = len; 213 expected += svvec[i].sfv_len; 214 if (sendfilev(*w->wfd, svvec, i, &xferred) == -1 || 215 xferred != expected) 216 w->werr++; 217 w->liov = 0; 218 w->niov = 0; 219 } while (0); 220 #else 221 do { 222 if (WRK_Flush(w) == 0 && 223 sendfile(*w->wfd, fd, &off, len) != len) 224 w->werr++; 225 } while (0); 226 #endif 194 227 #else 195 228 #error Unknown sendfile() implementation -
trunk/varnish-cache/bin/varnishd/tcp.c
r3083 r3113 39 39 #include <errno.h> 40 40 #include <sys/ioctl.h> 41 #ifdef HAVE_SYS_FILIO_H 42 #include <sys/filio.h> 43 #endif 41 44 #include <netdb.h> 42 45 #include <poll.h> -
trunk/varnish-cache/bin/varnishd/varnishd.c
r3077 r3113 114 114 extern struct stevedore sma_stevedore; 115 115 extern struct stevedore smf_stevedore; 116 #ifdef HAVE_LIBUMEM 117 extern struct stevedore smu_stevedore; 118 #endif 116 119 117 120 static struct choice stv_choice[] = { 118 121 { "file", &smf_stevedore }, 119 122 { "malloc", &sma_stevedore }, 123 #ifdef HAVE_LIBUMEM 124 { "umem", &smu_stevedore }, 125 #endif 120 126 { NULL, NULL } 121 127 }; … … 215 221 "-s kind[,storageoptions]", "Backend storage specification"); 216 222 fprintf(stderr, FMT, "", " -s malloc"); 223 #ifdef HAVE_LIBUMEM 224 fprintf(stderr, FMT, "", " -s umem"); 225 #endif 217 226 fprintf(stderr, FMT, "", " -s file [default: use /tmp]"); 218 227 fprintf(stderr, FMT, "", " -s file,<dir_or_file>"); -
trunk/varnish-cache/configure.ac
r3092 r3113 130 130 fi 131 131 ;; 132 *-*-solaris*) 133 AC_CHECK_HEADERS([sys/filio.h]) 134 AC_CHECK_LIB(sendfile, sendfile) 135 AC_CHECK_LIB(umem, malloc) 136 AC_CHECK_HEADERS([umem.h]) 137 138 if test "$ac_cv_lib_sendfile_sendfile" = yes; then 139 save_LIBS="${LIBS}" 140 LIBS="${NET_LIBS}" 141 AC_CHECK_FUNCS([sendfile]) 142 AC_CHECK_FUNCS([sendfilev]) 143 LIBS="${save_LIBS}" 144 fi 145 ;; 132 146 *) 133 147 AC_MSG_WARN([won't look for sendfile() on $host]) … … 192 206 fi 193 207 194 # --enable-po ll195 AC_ARG_ENABLE(po ll,196 AS_HELP_STRING([--enable-po ll],197 [use po llif available (default is YES)]),208 # --enable-ports 209 AC_ARG_ENABLE(ports, 210 AS_HELP_STRING([--enable-ports], 211 [use ports if available (default is YES)]), 198 212 , 199 [enable_po ll=yes])200 201 if test "$enable_po ll" = yes; then202 AC_CHECK_FUNCS([po ll])213 [enable_ports=yes]) 214 215 if test "$enable_ports" = yes; then 216 AC_CHECK_FUNCS([port_create]) 203 217 else 204 ac_cv_func_poll=no 205 fi 206 207 if test "$ac_cv_func_kqueue" != yes && 208 test "$ac_cv_func_epoll_ctl" != yes && 209 test "$ac_cv_func_poll" != yes; then 210 AC_MSG_ERROR([no usable acceptor mechanism]) 218 ac_cv_func_port_create=no 211 219 fi 212 220
