diff options
author | Torsten Marek <shlomme@debian.org> | 2005-11-27 14:39:54 +0000 |
---|---|---|
committer | Torsten Marek <shlomme@debian.org> | 2005-11-27 14:39:54 +0000 |
commit | 701d5359518f46aadc89655d38ff91e6eae4496d (patch) | |
tree | 5e47b76785345f850e9d9d196461d66c3e8e8828 /src/network_backends.h | |
download | lighttpd-701d5359518f46aadc89655d38ff91e6eae4496d.tar.gz |
[svn-inject] Installing original source of lighttpd
Diffstat (limited to 'src/network_backends.h')
-rw-r--r-- | src/network_backends.h | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/src/network_backends.h b/src/network_backends.h new file mode 100644 index 0000000..94650a7 --- /dev/null +++ b/src/network_backends.h @@ -0,0 +1,58 @@ +#ifndef _NETWORK_BACKENDS_H_ +#define _NETWORK_BACKENDS_H_ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <sys/types.h> + +/* on linux 2.4.x you get either sendfile or LFS */ +#if defined HAVE_SYS_SENDFILE_H && defined HAVE_SENDFILE && (!defined _LARGEFILE_SOURCE || defined HAVE_SENDFILE64) && defined HAVE_WRITEV && defined(__linux__) && !defined HAVE_SENDFILE_BROKEN +# define USE_LINUX_SENDFILE +# include <sys/sendfile.h> +# include <sys/uio.h> +#endif + +#if defined HAVE_SYS_UIO_H && defined HAVE_SENDFILE && defined HAVE_WRITEV && defined(__FreeBSD__) +# define USE_FREEBSD_SENDFILE +# include <sys/uio.h> +#endif + +#if defined HAVE_SYS_SENDFILE_H && defined HAVE_SENDFILEV && defined HAVE_WRITEV && defined(__sun) +# define USE_SOLARIS_SENDFILEV +# include <sys/sendfile.h> +# include <sys/uio.h> +#endif + +#if defined HAVE_SYS_UIO_H && defined HAVE_WRITEV +# define USE_WRITEV +# include <sys/uio.h> +#endif + +#if defined HAVE_SYS_MMAN_H && defined HAVE_MMAP +# define USE_MMAP +# include <sys/mman.h> +/* NetBSD 1.3.x needs it */ +# ifndef MAP_FAILED +# define MAP_FAILED -1 +# endif +#endif + +#if defined HAVE_SYS_UIO_H && defined HAVE_WRITEV && defined HAVE_SEND_FILE && defined(__aix) +# define USE_AIX_SENDFILE +#endif + +#include "base.h" + + +int network_write_chunkqueue_write(server *srv, connection *con, int fd, chunkqueue *cq); +int network_write_chunkqueue_writev(server *srv, connection *con, int fd, chunkqueue *cq); +int network_write_chunkqueue_linuxsendfile(server *srv, connection *con, int fd, chunkqueue *cq); +int network_write_chunkqueue_freebsdsendfile(server *srv, connection *con, int fd, chunkqueue *cq); +int network_write_chunkqueue_solarissendfilev(server *srv, connection *con, int fd, chunkqueue *cq); +#ifdef USE_OPENSSL +int network_write_chunkqueue_openssl(server *srv, connection *con, SSL *ssl, chunkqueue *cq); +#endif + +#endif |