Browse Source

add support for responses that are not keepalive, not chunked and don't have any content-length header

tags/weighttp-0.3
Thomas Porzelt 10 years ago
parent
commit
bdfdd127c1
2 changed files with 9 additions and 3 deletions
  1. 0
    1
      TODO
  2. 9
    2
      src/client.c

+ 0
- 1
TODO View File

@@ -1,4 +1,3 @@
- handle responses without content-length but connection: close
- timing statistics
- generally better statistics
- ssl support

+ 9
- 2
src/client.c View File

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


Loading…
Cancel
Save