summaryrefslogtreecommitdiff
path: root/src/network_backends.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/network_backends.h')
-rw-r--r--src/network_backends.h24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/network_backends.h b/src/network_backends.h
index 94650a7..5813253 100644
--- a/src/network_backends.h
+++ b/src/network_backends.h
@@ -2,8 +2,9 @@
#define _NETWORK_BACKENDS_H_
#ifdef HAVE_CONFIG_H
-#include "config.h"
+# include "config.h"
#endif
+#include "settings.h"
#include <sys/types.h>
@@ -14,7 +15,7 @@
# include <sys/uio.h>
#endif
-#if defined HAVE_SYS_UIO_H && defined HAVE_SENDFILE && defined HAVE_WRITEV && defined(__FreeBSD__)
+#if defined HAVE_SYS_UIO_H && defined HAVE_SENDFILE && defined HAVE_WRITEV && (defined(__FreeBSD__) || defined(__DragonFly__))
# define USE_FREEBSD_SENDFILE
# include <sys/uio.h>
#endif
@@ -30,7 +31,7 @@
# include <sys/uio.h>
#endif
-#if defined HAVE_SYS_MMAN_H && defined HAVE_MMAP
+#if defined HAVE_SYS_MMAN_H && defined HAVE_MMAP && defined ENABLE_MMAP
# define USE_MMAP
# include <sys/mman.h>
/* NetBSD 1.3.x needs it */
@@ -45,14 +46,19 @@
#include "base.h"
+/* return values:
+ * >= 0 : no error
+ * -1 : error (on our side)
+ * -2 : remote close
+ */
-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);
+int network_write_chunkqueue_write(server *srv, connection *con, int fd, chunkqueue *cq, off_t max_bytes);
+int network_write_chunkqueue_writev(server *srv, connection *con, int fd, chunkqueue *cq, off_t max_bytes);
+int network_write_chunkqueue_linuxsendfile(server *srv, connection *con, int fd, chunkqueue *cq, off_t max_bytes);
+int network_write_chunkqueue_freebsdsendfile(server *srv, connection *con, int fd, chunkqueue *cq, off_t max_bytes);
+int network_write_chunkqueue_solarissendfilev(server *srv, connection *con, int fd, chunkqueue *cq, off_t max_bytes);
#ifdef USE_OPENSSL
-int network_write_chunkqueue_openssl(server *srv, connection *con, SSL *ssl, chunkqueue *cq);
+int network_write_chunkqueue_openssl(server *srv, connection *con, SSL *ssl, chunkqueue *cq, off_t max_bytes);
#endif
#endif