From 2e21e899c98d197902976e6f2afec763693afe28 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Sun, 29 Dec 2002 09:21:32 +0000 Subject: [PATCH] Minor incompatible change to relaying, to match actual protocol. svn path=/trunk/icecast/; revision=4169 --- src/connection.c | 5 +++++ src/slave.c | 6 +++++- src/xslt.c | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/connection.c b/src/connection.c index 4894806a..68ffebe0 100644 --- a/src/connection.c +++ b/src/connection.c @@ -577,6 +577,11 @@ static void _handle_get_request(connection_t *con, INFO0("Client attempted to fetch allstreams.txt with bad password"); client_send_401(client); } else { + client->respcode = 200; + bytes = sock_write(client->con->sock, + "HTTP/1.0 200 OK\r\n\r\n"); + if(bytes > 0) client->con->sent_bytes = bytes; + avl_node *node; source_t *s; avl_tree_rlock(global.source_tree); diff --git a/src/slave.c b/src/slave.c index 89475bde..5dc2b358 100644 --- a/src/slave.c +++ b/src/slave.c @@ -104,7 +104,11 @@ static void *_slave_thread(void *arg) { sock_write(mastersock, "GET /allstreams.txt HTTP/1.0\r\nAuthorization: Basic %s\r\n\r\n", data); free(data); while (sock_read_line(mastersock, buf, sizeof(buf))) { - buf[strlen(buf)] = 0; + if(!strlen(buf)) + break; + } + + while (sock_read_line(mastersock, buf, sizeof(buf))) { avl_tree_rlock(global.source_tree); if (!source_find_mount(buf)) { avl_tree_unlock(global.source_tree); diff --git a/src/xslt.c b/src/xslt.c index f3c594f1..739098d6 100644 --- a/src/xslt.c +++ b/src/xslt.c @@ -111,6 +111,7 @@ static xsltStylesheetPtr xslt_get_stylesheet(char *fn) { cache[i].stylesheet = xsltParseStylesheetFile(fn); cache[i].cache_age = time(NULL); } + DEBUG1("Using cached sheet %i", i); return cache[i].stylesheet; } }