mirror of
https://gitlab.xiph.org/xiph/icecast-server.git
synced 2025-01-03 14:56:34 -05:00
fix m3u generation logic that was not working for static files
svn path=/icecast/trunk/icecast/; revision=7439
This commit is contained in:
parent
62bff456c2
commit
ebecd7cb0a
@ -841,11 +841,8 @@ static void _handle_get_request(connection_t *con,
|
|||||||
char *sourceuri = strdup(uri);
|
char *sourceuri = strdup(uri);
|
||||||
char *dot = strrchr(sourceuri, '.');
|
char *dot = strrchr(sourceuri, '.');
|
||||||
*dot = 0;
|
*dot = 0;
|
||||||
avl_tree_rlock(global.source_tree);
|
client->respcode = 200;
|
||||||
source = source_find_mount(sourceuri);
|
bytes = sock_write(client->con->sock,
|
||||||
if (source) {
|
|
||||||
client->respcode = 200;
|
|
||||||
bytes = sock_write(client->con->sock,
|
|
||||||
"HTTP/1.0 200 OK\r\n"
|
"HTTP/1.0 200 OK\r\n"
|
||||||
"Content-Type: audio/x-mpegurl\r\n\r\n"
|
"Content-Type: audio/x-mpegurl\r\n\r\n"
|
||||||
"http://%s:%d%s\r\n",
|
"http://%s:%d%s\r\n",
|
||||||
@ -853,33 +850,8 @@ static void _handle_get_request(connection_t *con,
|
|||||||
port,
|
port,
|
||||||
sourceuri
|
sourceuri
|
||||||
);
|
);
|
||||||
if(bytes > 0) client->con->sent_bytes = bytes;
|
if(bytes > 0) client->con->sent_bytes = bytes;
|
||||||
client_destroy(client);
|
client_destroy(client);
|
||||||
}
|
|
||||||
else if(fileserve) {
|
|
||||||
fullpath = util_get_path_from_normalised_uri(sourceuri);
|
|
||||||
if(stat(fullpath, &statbuf) == 0) {
|
|
||||||
fserve_client_create(client, fullpath);
|
|
||||||
free(fullpath);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
free(fullpath);
|
|
||||||
fullpath = util_get_path_from_normalised_uri(uri);
|
|
||||||
if(stat(fullpath, &statbuf) == 0) {
|
|
||||||
fserve_client_create(client, fullpath);
|
|
||||||
free(fullpath);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
free(fullpath);
|
|
||||||
client_send_404(client,
|
|
||||||
"The file you requested could not be found");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
client_send_404(client, "The file you requested could not be found");
|
|
||||||
}
|
|
||||||
avl_tree_unlock(global.source_tree);
|
|
||||||
free(sourceuri);
|
free(sourceuri);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user