[xiph-commits] r7440 - icecast/branches/kh/icecast/src

karl at motherfish-iii.xiph.org karl
Thu Aug 5 19:05:56 PDT 2004


Author: karl
Date: Thu Aug  5 19:05:56 2004
New Revision: 7440

Modified:
icecast/branches/kh/icecast/src/connection.c
Log:
resync with trunk. simplify m3u lookup, don't do the searching when the m3u
is requested, just return something suitable for players.


Modified: icecast/branches/kh/icecast/src/connection.c
===================================================================
--- icecast/branches/kh/icecast/src/connection.c	2004-07-31 22:25:07 UTC (rev 7439)
+++ icecast/branches/kh/icecast/src/connection.c	2004-08-01 01:48:12 UTC (rev 7440)
@@ -826,45 +826,17 @@
char *sourceuri = strdup(uri);
char *dot = strrchr(sourceuri, '.');
*dot = 0;
-        avl_tree_rlock(global.source_tree);
-        source = source_find_mount(sourceuri);
-           if (source) {
-            client->respcode = 200;
-            bytes = sock_write(client->con->sock,
-                    "HTTP/1.0 200 OK\r\n"
-                    "Content-Type: audio/x-mpegurl\r\n\r\n"
-                    "http://%s:%d%s\r\n",
-                    host,
-                    port,
-                    sourceuri
-                    );
-            if(bytes > 0) client->con->sent_bytes = bytes;
-            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);
+        client->respcode = 200;
+        bytes = sock_write(client->con->sock,
+                "HTTP/1.0 200 OK\r\n"
+                "Content-Type: audio/x-mpegurl\r\n\r\n"
+                "http://%s:%d%s\r\n",
+                host,
+                port,
+                sourceuri
+                );
+        if(bytes > 0) client->con->sent_bytes = bytes;
+        client_destroy(client);
free(sourceuri);
if (uri != passed_uri) free (uri);
return;



More information about the commits mailing list