1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2024-12-04 14:46:30 -05:00

Feature: Support HTTP keep-alive for SOURCE connections if they give us a content-length (useful for pokes)

This commit is contained in:
Philipp Schafft 2018-12-17 08:46:52 +00:00
parent b02f306521
commit 825f92d6e2

View File

@ -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 */