summaryrefslogtreecommitdiff
path: root/src/network_write.c
diff options
context:
space:
mode:
authorJan Kneschke <jan@kneschke.de>2005-09-26 08:52:37 +0000
committerJan Kneschke <jan@kneschke.de>2005-09-26 08:52:37 +0000
commit621bb08a53d56e7757f5f98db2e011934ef14873 (patch)
tree04f67ae84bf3e0d2d1f709fa0720fa90fcb8cbf3 /src/network_write.c
parenta8f0168ebfef7fe07acdc7fd111c5d7e415bdb15 (diff)
downloadlighttpd-git-621bb08a53d56e7757f5f98db2e011934ef14873.tar.gz
added the fd as parameter for the write() functions
- the plugins can use them now too git-svn-id: svn+ssh://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@737 152afb58-edef-0310-8abb-c4023f1b3aa9
Diffstat (limited to 'src/network_write.c')
-rw-r--r--src/network_write.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/network_write.c b/src/network_write.c
index 7c0139ae..9e713c63 100644
--- a/src/network_write.c
+++ b/src/network_write.c
@@ -24,8 +24,7 @@
#include <sys/resource.h>
#endif
-int network_write_chunkqueue_write(server *srv, connection *con, chunkqueue *cq) {
- const int fd = con->fd;
+int network_write_chunkqueue_write(server *srv, connection *con, int fd, chunkqueue *cq) {
chunk *c;
size_t chunks_written = 0;
@@ -60,7 +59,6 @@ int network_write_chunkqueue_write(server *srv, connection *con, chunkqueue *cq)
#endif
c->offset += r;
- con->bytes_written += r;
cq->bytes_out += r;
if (c->offset == (off_t)c->mem->used - 1) {
@@ -109,7 +107,7 @@ int network_write_chunkqueue_write(server *srv, connection *con, chunkqueue *cq)
return -1;
}
close(ifd);
-
+
if ((r = write(fd, p + offset, toSend)) <= 0) {
log_error_write(srv, __FILE__, __LINE__, "ss", "write failed: ", strerror(errno));
@@ -136,7 +134,6 @@ int network_write_chunkqueue_write(server *srv, connection *con, chunkqueue *cq)
}
#endif
c->offset += r;
- con->bytes_written += r;
cq->bytes_out += r;
if (c->offset == c->file.length) {