Commit dcffbb38 authored by Karl Heyes's avatar Karl Heyes

header fixup for listeners. Tell any proxies to not cache and add minor tweaks

for flash players. closes #1115

svn path=/icecast/trunk/icecast/; revision=14014
parent f9c3fc91
......@@ -347,6 +347,11 @@ static int format_prepare_headers (source_t *source, client_t *client)
remaining -= bytes;
ptr += bytes;
/* prevent proxy servers from caching */
bytes = snprintf (ptr, remaining, "Cache-Control: no-cache\r\n");
remaining -= bytes;
ptr += bytes;
bytes = snprintf (ptr, remaining, "\r\n");
remaining -= bytes;
ptr += bytes;
......
......@@ -638,16 +638,24 @@ static int format_mp3_create_client_data(source_t *source, client_t *client)
unsigned remaining = 4096 - client->refbuf->len + 2;
char *ptr = client->refbuf->data + client->refbuf->len - 2;
int bytes;
const char *useragent;
if (client_mp3 == NULL)
return -1;
/* hack for flash player, it wants a length */
if (httpp_getvar(client->parser, "x-flash-version"))
/* hack for flash player, it wants a length. It has also been reported that the useragent
* appears as MSIE if run in internet explorer */
useragent = httpp_getvar (client->parser, "user-agent");
if (httpp_getvar(client->parser, "x-flash-version") ||
(useragent && strstr(useragent, "MSIE")))
{
bytes = snprintf (ptr, remaining, "Content-Length: 347122319\r\n");
bytes = snprintf (ptr, remaining, "Content-Length: 221183499\r\n");
remaining -= bytes;
ptr += bytes;
/* avoid browser caching, reported via forum */
bytes = snprintf (ptr, remaining, "Expires: Mon, 26 Jul 1997 05:00:00 GMT\r\n");
remaining -= bytes;
ptr += bytes;
}
client->format_data = client_mp3;
......
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