Changeset 1575

Show
Ignore:
Timestamp:
06/18/08 17:09:18 (4 months ago)
Author:
alo
Message:

--

Files:

Legend:

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

    r1574 r1575  
    112008-06-18  Alvaro Lopez Ortega  <alvaro@alobbs.com> 
     2 
     3        * cherokee/socket.c (cherokee_socket_sendfile): This patch fixes 
     4        and simplfies the sendfile() support of MacOS X. 
    25 
    36        * cherokee/Makefile.am (distclean-local): It has to clean the two 
  • cherokee/trunk/cherokee/socket.c

    r1446 r1575  
    14471447 
    14481448#elif DARWIN_SENDFILE_API 
    1449         int            re; 
    1450         struct sf_hdtr hdr; 
    1451         struct iovec   hdtrl; 
    1452         off_t          _sent = size; 
    1453  
    1454         hdr.headers    = &hdtrl; 
    1455         hdr.hdr_cnt    = 1; 
    1456         hdr.trailers   = NULL; 
    1457         hdr.trl_cnt    = 0; 
    1458          
    1459         hdtrl.iov_base = NULL; 
    1460         hdtrl.iov_len  = 0; 
     1449        int   re; 
     1450        off_t _sent = size; 
    14611451 
    14621452        /* MacOS X: BSD-like System Call 
     
    14711461                               *offset,                   /* off_t           offset */ 
    14721462                               &_sent,                    /* off_t          *len    */ 
    1473                                &hdr,                      /* struct sf_hdtr *hdtr   */ 
     1463                               NULL,                      /* struct sf_hdtr *hdtr   */ 
    14741464                               0);                        /* int             flags  */ 
    14751465        }  while (re == -1 && errno == EINTR); 
     
    14781468                switch (errno) { 
    14791469                case EAGAIN: 
    1480 #if defined(EWOULDBLOCK) && (EWOULDBLOCK != EAGAIN) 
    1481                 case EWOULDBLOCK: 
    1482 #endif 
    1483                         if (*sent < 1) 
     1470                        /* It might have sent some information 
     1471                         */ 
     1472                        if (_sent <= 0) 
    14841473                                return ret_eagain; 
    1485  
    1486                         /* else it's ok, something has been sent. 
    1487                          */ 
    14881474                        break; 
    14891475                case ENOSYS: