Browse Source

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 16 years ago
parent
commit
b32a18b1e8
  1. 5
      src/network_freebsd_sendfile.c
  2. 6
      src/network_linux_sendfile.c
  3. 2
      src/network_openssl.c
  4. 2
      src/network_write.c
  5. 6
      src/network_writev.c

5
src/network_freebsd_sendfile.c

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

6
src/network_linux_sendfile.c

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

2
src/network_openssl.c

@ -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) {

2
src/network_write.c

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

6
src/network_writev.c

@ -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: {

Loading…
Cancel
Save