Annotation of embedaddon/lighttpd/src/network_backends.h, revision 1.1.1.1
1.1 misho 1: #ifndef _NETWORK_BACKENDS_H_
2: #define _NETWORK_BACKENDS_H_
3:
4: #ifdef HAVE_CONFIG_H
5: # include "config.h"
6: #endif
7: #include "settings.h"
8:
9: #include <sys/types.h>
10:
11: /* on linux 2.4.x you get either sendfile or LFS */
12: #if defined HAVE_SYS_SENDFILE_H && defined HAVE_SENDFILE && (!defined _LARGEFILE_SOURCE || defined HAVE_SENDFILE64) && defined HAVE_WRITEV && defined(__linux__) && !defined HAVE_SENDFILE_BROKEN
13: # define USE_LINUX_SENDFILE
14: # include <sys/sendfile.h>
15: # include <sys/uio.h>
16: #endif
17:
18: #if defined HAVE_SYS_UIO_H && defined HAVE_SENDFILE && defined HAVE_WRITEV && (defined(__FreeBSD__) || defined(__DragonFly__))
19: # define USE_FREEBSD_SENDFILE
20: # include <sys/uio.h>
21: #endif
22:
23: #if defined HAVE_SYS_SENDFILE_H && defined HAVE_SENDFILEV && defined HAVE_WRITEV && defined(__sun)
24: # define USE_SOLARIS_SENDFILEV
25: # include <sys/sendfile.h>
26: # include <sys/uio.h>
27: #endif
28:
29: #if defined HAVE_SYS_UIO_H && defined HAVE_WRITEV
30: # define USE_WRITEV
31: # include <sys/uio.h>
32: #endif
33:
34: #if defined HAVE_SYS_MMAN_H && defined HAVE_MMAP && defined ENABLE_MMAP
35: # define USE_MMAP
36: # include <sys/mman.h>
37: /* NetBSD 1.3.x needs it */
38: # ifndef MAP_FAILED
39: # define MAP_FAILED -1
40: # endif
41: #endif
42:
43: #if defined HAVE_SYS_UIO_H && defined HAVE_WRITEV && defined HAVE_SEND_FILE && defined(__aix)
44: # define USE_AIX_SENDFILE
45: #endif
46:
47: #include "base.h"
48:
49: /* return values:
50: * >= 0 : no error
51: * -1 : error (on our side)
52: * -2 : remote close
53: */
54:
55: int network_write_chunkqueue_write(server *srv, connection *con, int fd, chunkqueue *cq, off_t max_bytes);
56: int network_write_chunkqueue_writev(server *srv, connection *con, int fd, chunkqueue *cq, off_t max_bytes);
57: int network_write_chunkqueue_linuxsendfile(server *srv, connection *con, int fd, chunkqueue *cq, off_t max_bytes);
58: int network_write_chunkqueue_freebsdsendfile(server *srv, connection *con, int fd, chunkqueue *cq, off_t max_bytes);
59: int network_write_chunkqueue_solarissendfilev(server *srv, connection *con, int fd, chunkqueue *cq, off_t max_bytes);
60: #ifdef USE_OPENSSL
61: int network_write_chunkqueue_openssl(server *srv, connection *con, SSL *ssl, chunkqueue *cq, off_t max_bytes);
62: #endif
63:
64: #endif
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>