mirror of
https://gitlab.xiph.org/xiph/icecast-server.git
synced 2025-02-02 15:07:36 -05:00
Fix: Make actual streaming work
This commit is contained in:
parent
ded5c145f1
commit
f567b6240a
25
src/format.c
25
src/format.c
@ -287,7 +287,7 @@ int format_advance_queue(source_t *source, client_t *client)
|
||||
* calling functions will use a already freed client struct and
|
||||
* cause a segfault!
|
||||
*/
|
||||
static int format_prepare_headers (source_t *source, client_t *client)
|
||||
static int format_prepare_headers_http (source_t *source, client_t *client)
|
||||
{
|
||||
size_t remaining;
|
||||
char *ptr;
|
||||
@ -404,13 +404,34 @@ static int format_prepare_headers (source_t *source, client_t *client)
|
||||
ptr += bytes;
|
||||
|
||||
client->refbuf->len -= remaining;
|
||||
if (source->format->create_client_data)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int format_prepare_headers (source_t *source, client_t *client)
|
||||
{
|
||||
|
||||
switch (client->protocol) {
|
||||
case ICECAST_PROTOCOL_HTTP:
|
||||
case ICECAST_PROTOCOL_SHOUTCAST:
|
||||
if (format_prepare_headers_http(source, client) != 0)
|
||||
return -1;
|
||||
break;
|
||||
case ICECAST_PROTOCOL_GOPHER:
|
||||
client->refbuf->len = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (source->format->create_client_data) {
|
||||
if (source->format->create_client_data (source, client) < 0) {
|
||||
ICECAST_LOG_ERROR("Client format header generation failed. "
|
||||
"(Likely not enough or wrong source data) Dropping client.");
|
||||
client->respcode = 500;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user