Commit 825f92d6 authored by Philipp Schafft's avatar Philipp Schafft 🦁

Feature: Support HTTP keep-alive for SOURCE connections if they give us a...

Feature: Support HTTP keep-alive for SOURCE connections if they give us a content-length (useful for pokes)
parent b02f3065
......@@ -115,6 +115,16 @@ void client_complete(client_t *client)
long long unsigned int scannumber;
int have = 0;
if (!have) {
header = httpp_getvar(client->parser, "content-length");
if (header) {
if (sscanf(header, "%llu", &scannumber) == 1) {
client->request_body_length = scannumber;
have = 1;
}
}
}
if (!have) {
if (client->parser->req_type == httpp_req_source) {
client->request_body_length = -1; /* streaming */
......@@ -132,16 +142,6 @@ void client_complete(client_t *client)
}
}
if (!have) {
header = httpp_getvar(client->parser, "content-length");
if (header) {
if (sscanf(header, "%llu", &scannumber) == 1) {
client->request_body_length = scannumber;
have = 1;
}
}
}
if (!have) {
if (client->parser->req_type == httpp_req_put) {
/* As we don't know yet, we asume this PUT is in streaming mode */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment