From e485768d1e8f098bab2c6fc81ffaaeecd8faac2c Mon Sep 17 00:00:00 2001 From: Jan Kneschke Date: Mon, 9 Jan 2006 16:53:47 +0000 Subject: [PATCH] handle a sendfile() = 0 is connection closed by remote side git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@930 152afb58-edef-0310-8abb-c4023f1b3aa9 --- src/network_linux_sendfile.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/network_linux_sendfile.c b/src/network_linux_sendfile.c index 5628a94e..57523858 100644 --- a/src/network_linux_sendfile.c +++ b/src/network_linux_sendfile.c @@ -173,6 +173,11 @@ int network_write_chunkqueue_linuxsendfile(server *srv, connection *con, int fd, return -1; } } + + if (r == 0) { + /* we got a event to write put we couldn't. remote side closed ? */ + return -2; + } c->offset += r; cq->bytes_out += r;