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