summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Porzelt <tp@cryosphere.de>2009-09-11 20:16:03 +0200
committerThomas Porzelt <tp@cryosphere.de>2009-09-11 20:16:03 +0200
commit2a8afc8dfbcf2c46822e2e47744e658da89998c6 (patch)
tree60b4022ba27864041699839adbe48c3463be9c1a
parent572ab4496e7abd3d775b2634609bf2f8f0d0791c (diff)
downloadweighttp-2a8afc8dfbcf2c46822e2e47744e658da89998c6.tar.gz
weighttp-2a8afc8dfbcf2c46822e2e47744e658da89998c6.zip
fix handling of responses bigger than the client BUFFER_SIZE (32kb)
-rw-r--r--src/client.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/client.c b/src/client.c
index 9b6f25c..a5733ee 100644
--- a/src/client.c
+++ b/src/client.c
@@ -219,7 +219,7 @@ void client_state_machine(Client *client) {
}
case CLIENT_READING:
while (1) {
- r = read(client->sock_watcher.fd, &client->buffer[client->buffer_offset], sizeof(client->buffer) - client->buffer_offset);
+ r = read(client->sock_watcher.fd, &client->buffer[client->buffer_offset], sizeof(client->buffer) - client->buffer_offset - 1);
//printf("read(): %d\n", r);
if (r == -1) {
/* error */