mirror of
https://gitlab.xiph.org/xiph/icecast-server.git
synced 2024-11-03 04:17:17 -05:00
someone reported a quicktime hack needed for m3u, needing icy:// links
svn path=/icecast/branches/kh/icecast/; revision=9752
This commit is contained in:
parent
9faab0e8dd
commit
5e61e76b24
12
src/fserve.c
12
src/fserve.c
@ -412,6 +412,12 @@ int fserve_client_create (client_t *httpclient, const char *path)
|
||||
char *host = httpp_getvar (httpclient->parser, "host");
|
||||
char *sourceuri = strdup (path);
|
||||
char *dot = strrchr (sourceuri, '.');
|
||||
char *protocol = "http";
|
||||
char *agent = httpp_getvar (httpclient->parser, "user-agent");
|
||||
|
||||
if (agent && (strstr (agent, "QTS") || strstr (agent, "QuickTime")))
|
||||
protocol = "icy";
|
||||
|
||||
*dot = 0;
|
||||
httpclient->respcode = 200;
|
||||
if (host == NULL)
|
||||
@ -420,7 +426,8 @@ int fserve_client_create (client_t *httpclient, const char *path)
|
||||
snprintf (httpclient->refbuf->data, BUFSIZE,
|
||||
"HTTP/1.0 200 OK\r\n"
|
||||
"Content-Type: audio/x-mpegurl\r\n\r\n"
|
||||
"http://%s:%d%s\r\n",
|
||||
"%s://%s:%d%s\r\n",
|
||||
protocol,
|
||||
config->hostname, config->port,
|
||||
sourceuri
|
||||
);
|
||||
@ -431,7 +438,8 @@ int fserve_client_create (client_t *httpclient, const char *path)
|
||||
snprintf (httpclient->refbuf->data, BUFSIZE,
|
||||
"HTTP/1.0 200 OK\r\n"
|
||||
"Content-Type: audio/x-mpegurl\r\n\r\n"
|
||||
"http://%s%s\r\n",
|
||||
"%s://%s%s\r\n",
|
||||
protocol,
|
||||
host,
|
||||
sourceuri
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user