mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-08 11:53:00 -04:00
Support sendfile on solaris: patch from Caitlin Mercer.
svn:r1419
This commit is contained in:
parent
f22823982f
commit
22bd5b4287
@ -14,6 +14,7 @@ Changes in 2.0.3-alpha:
|
||||
o Add an evbuffer_search_range() function to search a bounded range of a buffer.
|
||||
o Fix a rare crash bug in evdns.
|
||||
o Have bufferevent_socket_connect() with no arguments put a bufferevent into connecting mode.
|
||||
o Support sendfile on Solaris: patch from Caitlin Mercer.
|
||||
|
||||
|
||||
Changes in 2.0.2-alpha:
|
||||
|
12
buffer.c
12
buffer.c
@ -104,6 +104,9 @@
|
||||
#elif defined(_EVENT_HAVE_SENDFILE) && defined(__APPLE__)
|
||||
#define USE_SENDFILE 1
|
||||
#define SENDFILE_IS_MACOSX 1
|
||||
#elif defined(_EVENT_HAVE_SENDFILE) && defined(__sun__) && defined(__svr4__)
|
||||
#define USE_SENDFILE 1
|
||||
#define SENDFILE_IS_SOLARIS 1
|
||||
#endif
|
||||
|
||||
#ifdef USE_SENDFILE
|
||||
@ -1785,7 +1788,7 @@ evbuffer_write_sendfile(struct evbuffer *buffer, evutil_socket_t fd,
|
||||
#if defined(SENDFILE_IS_MACOSX) || defined(SENDFILE_IS_FREEBSD)
|
||||
int res;
|
||||
off_t len = chain->off;
|
||||
#elif SENDFILE_IS_LINUX
|
||||
#elif defined(SENDFILE_IS_LINUX) || defined(SENDFILE_IS_SOLARIS)
|
||||
ev_ssize_t res;
|
||||
off_t offset = chain->misalign;
|
||||
#endif
|
||||
@ -1812,6 +1815,13 @@ evbuffer_write_sendfile(struct evbuffer *buffer, evutil_socket_t fd,
|
||||
return (0);
|
||||
}
|
||||
return (res);
|
||||
#elif defined(SENDFILE_IS_SOLARIS)
|
||||
res = sendfile(fd, info->fd, &offset, chain->off);
|
||||
if (res == -1 && EVUTIL_ERR_RW_RETRIABLE(errno)) {
|
||||
/* if this is EAGAIN or EINTR return 0; otherwise, -1 */
|
||||
return (0);
|
||||
}
|
||||
return (res);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
@ -53,6 +53,7 @@ AC_SEARCH_LIBS([inet_ntoa], [nsl])
|
||||
AC_SEARCH_LIBS([socket], [socket])
|
||||
AC_SEARCH_LIBS([inet_aton], [resolv])
|
||||
AC_SEARCH_LIBS([clock_gettime], [rt])
|
||||
AC_SEARCH_LIBS([sendfile], [sendfile])
|
||||
|
||||
dnl Determine if we have zlib for regression tests
|
||||
dnl Don't put this one in LIBS
|
||||
|
Loading…
x
Reference in New Issue
Block a user