Commit 46047723 authored by Philipp Schafft's avatar Philipp Schafft 🦁

Feature: Consider encoding backend EOF state

parent 38436c3f
......@@ -439,11 +439,16 @@ void client_set_queue(client_t *client, refbuf_t *refbuf)
ssize_t client_body_read(client_t *client, void *buf, size_t len)
{
ICECAST_LOG_DEBUG("Reading from body (client=%p)", client);
return client_read_bytes(client, buf, len);
}
int client_body_eof(client_t *client)
/* we might un-static this if needed at some time in distant future. -- ph3-der-loewe, 2018-04-17 */
static int client_eof(client_t *client)
{
if (!client)
return -1;
if (!client->con)
return 0;
......@@ -455,3 +460,22 @@ int client_body_eof(client_t *client)
return 0;
}
int client_body_eof(client_t *client)
{
int ret = -1;
if (!client)
return -1;
if (client->encoding) {
ICECAST_LOG_DEBUG("Looking for body EOF with encoding (client=%p)", client);
ret = httpp_encoding_eof(client->encoding, (int(*)(void*))client_eof, client);
} else {
ICECAST_LOG_DEBUG("Looking for body EOF without encoding (client=%p)", client);
ret = client_eof(client);
}
ICECAST_LOG_DEBUG("... result is: %i (client=%p)", ret, client);
return ret;
}
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