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
This commit is contained in:
Jan Kneschke 2006-01-09 16:53:47 +00:00
parent 2a4080a88b
commit e485768d1e
1 changed files with 5 additions and 0 deletions

View File

@ -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;