Changeset 583
- Timestamp:
- 01/04/07 00:20:24 (2 years ago)
- Files:
-
- cherokee/trunk/ChangeLog (modified) (1 diff)
- cherokee/trunk/cherokee/handler_file.c (modified) (1 diff)
- cherokee/trunk/cherokee/socket.c (modified) (3 diffs)
- cherokee/trunk/configure.in (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
cherokee/trunk/ChangeLog
r581 r583 1 2007-01-04 Alvaro Lopez Ortega <alvaro@alobbs.com> 2 3 * cherokee/socket.c (cherokee_socket_sendfile): Added a static 4 boolean variable to store whether the system doesn't support the 5 sendfile() function, in that way, this wrapper function will 6 return faster since the systems reports ENOSYS once. 7 8 * cherokee/handler_file.c (cherokee_handler_file_init): Removed 9 check for HAVE_SENDFILE_BROKEN. 10 11 * configure.in: Removed sendfile() test. It was declaring a 12 superfluous macro called HAVE_SENDFILE_BROKEN if the system had a 13 buggy sendfile implementation (like in some Linux 2.2 versions). 14 1 15 2007-01-03 A.D.F <adefacc@tin.it> 2 16 cherokee/trunk/cherokee/handler_file.c
r578 r583 535 535 (conn->socket.is_tls == non_TLS)); 536 536 537 # ifdef HAVE_SENDFILE_BROKEN538 fhdl->using_sendfile = false;539 # endif540 541 537 if (fhdl->using_sendfile) { 542 538 cherokee_connection_set_cork (conn, 1); cherokee/trunk/cherokee/socket.c
r582 r583 1139 1139 cherokee_socket_sendfile (cherokee_socket_t *socket, int fd, size_t size, off_t *offset, ssize_t *sent) 1140 1140 { 1141 static cherokee_boolean_t no_sys = false; 1142 1143 /* Exit if there is no sendfile() function in the system 1144 */ 1145 if (unlikely (no_sys)) 1146 return ret_no_sys; 1147 1141 1148 /* If there is nothing to send then return now, this may be 1142 1149 * needed in some systems (i.e. *BSD) because value 0 may have … … 1176 1183 if (*sent < 0) { 1177 1184 switch (errno) { 1178 case ENOSYS: return ret_no_sys; 1185 case ENOSYS: 1186 no_sys = true; 1187 return ret_no_sys; 1179 1188 case EAGAIN: return ret_eagain; 1180 1189 } … … 1236 1245 switch (errno) { 1237 1246 case ENOSYS: 1247 no_sys = true; 1238 1248 return ret_no_sys; 1239 1249 case EAGAIN: cherokee/trunk/configure.in
r535 r583 663 663 SENDFILE_CHECK 664 664 665 # Is sendfile broken?666 AC_MSG_CHECKING(if sendfile works)667 AC_RUN_IFELSE([#include <errno.h>668 int main() {669 int o = 0;670 if (-1 == sendfile(0, 0, &o, 0) && errno == ENOSYS) return -1;671 return 0;672 } ],673 AC_MSG_RESULT(yes),674 [ AC_MSG_RESULT(no)675 AC_DEFINE([HAVE_SENDFILE_BROKEN], [1], [broken sendfile])],676 AC_MSG_RESULT(cross, assuming: yes))677 678 665 # readdir_r() 679 666 LIBWWW_READDIR_R_TYPE