updated cq->written and con->bytes_written correctly

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@728 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.6
Jan Kneschke 2005-09-22 09:08:06 +00:00
parent dccb266a39
commit b32a18b1e8
5 changed files with 13 additions and 8 deletions

View File

@ -104,13 +104,14 @@ int network_write_chunkqueue_freebsdsendfile(server *srv, connection *con, chunk
}
/* check which chunks have been written */
cq->bytes_out += r;
con->bytes_written += r;
for(i = 0, tc = c; i < num_chunks; i++, tc = tc->next) {
if (r >= (ssize_t)chunks[i].iov_len) {
/* written */
r -= chunks[i].iov_len;
tc->offset += chunks[i].iov_len;
con->bytes_written += chunks[i].iov_len;
if (chunk_finished) {
/* skip the chunks from further touches */
@ -124,7 +125,6 @@ int network_write_chunkqueue_freebsdsendfile(server *srv, connection *con, chunk
/* partially written */
tc->offset += r;
con->bytes_written += r;
chunk_finished = 0;
break;
@ -182,6 +182,7 @@ int network_write_chunkqueue_freebsdsendfile(server *srv, connection *con, chunk
c->offset += r;
con->bytes_written += r;
cq->bytes_out += r;
if (c->offset == c->file.length) {
chunk_finished = 1;

View File

@ -95,7 +95,9 @@ int network_write_chunkqueue_linuxsendfile(server *srv, connection *con, chunkqu
}
/* check which chunks have been written */
cq->bytes_out += r;
con->bytes_written += r;
for(i = 0, tc = c; i < num_chunks; i++, tc = tc->next) {
if (r >= (ssize_t)chunks[i].iov_len) {
/* written */
@ -119,8 +121,6 @@ int network_write_chunkqueue_linuxsendfile(server *srv, connection *con, chunkqu
break;
}
}
cq->bytes_out += r;
con->bytes_written += r;
break;
}

View File

@ -123,6 +123,7 @@ int network_write_chunkqueue_openssl(server *srv, connection *con, chunkqueue *c
} else {
c->offset += r;
con->bytes_written += r;
cq->bytes_out += r;
}
if (c->offset == (off_t)c->mem->used - 1) {
@ -208,6 +209,7 @@ int network_write_chunkqueue_openssl(server *srv, connection *con, chunkqueue *c
} else {
c->offset += r;
con->bytes_written += r;
cq->bytes_out += r;
}
if (c->offset == c->file.length) {

View File

@ -61,6 +61,7 @@ int network_write_chunkqueue_write(server *srv, connection *con, chunkqueue *cq)
c->offset += r;
con->bytes_written += r;
cq->bytes_out += r;
if (c->offset == (off_t)c->mem->used - 1) {
chunk_finished = 1;
@ -136,6 +137,7 @@ 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) {
chunk_finished = 1;

View File

@ -116,6 +116,9 @@ int network_write_chunkqueue_writev(server *srv, connection *con, chunkqueue *cq
}
}
cq->bytes_out += r;
con->bytes_written += r;
/* check which chunks have been written */
for(i = 0, tc = c; i < num_chunks; i++, tc = tc->next) {
@ -142,9 +145,6 @@ int network_write_chunkqueue_writev(server *srv, connection *con, chunkqueue *cq
}
}
cq->bytes_out += r;
con->bytes_written += r;
break;
}
case FILE_CHUNK: {