Changeset 583

Show
Ignore:
Timestamp:
01/04/07 00:20:24 (2 years ago)
Author:
alo
Message:

--

Files:

Legend:

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

    r581 r583  
     12007-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 
    1152007-01-03  A.D.F  <adefacc@tin.it> 
    216 
  • cherokee/trunk/cherokee/handler_file.c

    r578 r583  
    535535                                (conn->socket.is_tls == non_TLS)); 
    536536 
    537 # ifdef HAVE_SENDFILE_BROKEN 
    538         fhdl->using_sendfile = false; 
    539 # endif 
    540  
    541537        if (fhdl->using_sendfile) { 
    542538                cherokee_connection_set_cork (conn, 1); 
  • cherokee/trunk/cherokee/socket.c

    r582 r583  
    11391139cherokee_socket_sendfile (cherokee_socket_t *socket, int fd, size_t size, off_t *offset, ssize_t *sent) 
    11401140{ 
     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 
    11411148        /* If there is nothing to send then return now, this may be 
    11421149         * needed in some systems (i.e. *BSD) because value 0 may have 
     
    11761183        if (*sent < 0) { 
    11771184                switch (errno) { 
    1178                 case ENOSYS: return ret_no_sys; 
     1185                case ENOSYS:  
     1186                        no_sys = true; 
     1187                        return ret_no_sys; 
    11791188                case EAGAIN: return ret_eagain; 
    11801189                } 
     
    12361245                switch (errno) { 
    12371246                case ENOSYS: 
     1247                        no_sys = true; 
    12381248                        return ret_no_sys; 
    12391249                case EAGAIN: 
  • cherokee/trunk/configure.in

    r535 r583  
    663663SENDFILE_CHECK 
    664664 
    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  
    678665# readdir_r() 
    679666LIBWWW_READDIR_R_TYPE