summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Porzelt <tp@cryosphere.de>2009-10-04 17:45:19 +0200
committerThomas Porzelt <tp@cryosphere.de>2009-10-04 17:45:19 +0200
commitbdfdd127c10729d8d2ad1321344ac25c97162f53 (patch)
tree211826637613008917f88ebf90b97972db9d2ce3
parent9df53d5efc7b5876aa31aba9e641524cfdfd33e0 (diff)
downloadweighttp-bdfdd127c10729d8d2ad1321344ac25c97162f53.tar.gz
weighttp-bdfdd127c10729d8d2ad1321344ac25c97162f53.zip
add support for responses that are not keepalive, not chunked and don't have any content-length header
-rw-r--r--TODO1
-rw-r--r--src/client.c11
2 files changed, 9 insertions, 3 deletions
diff --git a/TODO b/TODO
index e6a001a..b0a0fde 100644
--- a/TODO
+++ b/TODO
@@ -1,4 +1,3 @@
-- handle responses without content-length but connection: close
- timing statistics
- generally better statistics
- ssl support
diff --git a/src/client.c b/src/client.c
index 0e8f868..f6e31cc 100644
--- a/src/client.c
+++ b/src/client.c
@@ -259,8 +259,15 @@ void client_state_machine(Client *client) {
}
} else {
/* disconnect */
- client->state = CLIENT_ERROR;
- break;
+ if (client->parser_state == PARSER_BODY && !client->keepalive && client->status_200
+ && !client->chunked && client->content_length == -1) {
+ client->success = 1;
+ client->state = CLIENT_END;
+ } else {
+ client->state = CLIENT_ERROR;
+ }
+
+ goto start;
}
}