[xiph-commits] r7802 - in icecast/branches/kh/icecast: src web
karl at motherfish-iii.xiph.org
karl at motherfish-iii.xiph.org
Sun Sep 19 12:38:09 PDT 2004
Author: karl
Date: 2004-09-19 12:38:09 -0700 (Sun, 19 Sep 2004)
New Revision: 7802
Modified:
icecast/branches/kh/icecast/src/xslt.c
icecast/branches/kh/icecast/src/xslt.h
icecast/branches/kh/icecast/web/status.xsl
icecast/branches/kh/icecast/web/style.css
Log:
report of win32 faulting with newer xml2 libs, initial update for testing
Modified: icecast/branches/kh/icecast/src/xslt.c
===================================================================
--- icecast/branches/kh/icecast/src/xslt.c 2004-09-19 19:30:20 UTC (rev 7801)
+++ icecast/branches/kh/icecast/src/xslt.c 2004-09-19 19:38:09 UTC (rev 7802)
@@ -99,7 +99,7 @@
return oldest;
}
-static xsltStylesheetPtr xslt_get_stylesheet(char *fn) {
+static xsltStylesheetPtr xslt_get_stylesheet(const char *fn) {
int i;
int empty = -1;
struct stat file;
@@ -146,16 +146,13 @@
return cache[i].stylesheet;
}
-void xslt_transform(xmlDocPtr doc, char *xslfilename, client_t *client)
+void xslt_transform(xmlDocPtr doc, const char *xslfilename, client_t *client)
{
- xmlOutputBufferPtr outputBuffer;
xmlDocPtr res;
xsltStylesheetPtr cur;
- const char *params[16 + 1];
- size_t count,bytes;
+ xmlChar *string;
+ int len;
- params[0] = NULL;
-
xmlSubstituteEntitiesDefault(1);
xmlLoadExtDtdDefaultValue = 1;
@@ -163,28 +160,22 @@
cur = xslt_get_stylesheet(xslfilename);
thread_mutex_unlock(&xsltlock);
- if (cur == NULL) {
- bytes = sock_write_string(client->con->sock,
- (char *)"Could not parse XSLT file");
- if(bytes > 0) client->con->sent_bytes += bytes;
-
+ if (cur == NULL)
+ {
+ const char error[] = "Could not parse XSLT file";
+
+ client_send_bytes (client, error, sizeof (error)-1);
return;
}
- res = xsltApplyStylesheet(cur, doc, params);
+ res = xsltApplyStylesheet(cur, doc, NULL);
- outputBuffer = xmlAllocOutputBuffer(NULL);
-
- count = xsltSaveResultTo(outputBuffer, res, cur);
-
- /* Add null byte to end. */
- bytes = xmlOutputBufferWrite(outputBuffer, 1, "");
-
- if(sock_write_string(client->con->sock,
- (char *)outputBuffer->buffer->content))
- client->con->sent_bytes += bytes;
-
- xmlOutputBufferClose(outputBuffer);
+ xmlDocDumpFormatMemory (res, &string, &len, 1);
+ if (string)
+ {
+ client_send_bytes (client, string, len);
+ xmlFree (string);
+ }
xmlFreeDoc(res);
}
Modified: icecast/branches/kh/icecast/src/xslt.h
===================================================================
--- icecast/branches/kh/icecast/src/xslt.h 2004-09-19 19:30:20 UTC (rev 7801)
+++ icecast/branches/kh/icecast/src/xslt.h 2004-09-19 19:38:09 UTC (rev 7802)
@@ -34,7 +34,7 @@
#include "stats.h"
-void xslt_transform(xmlDocPtr doc, char *xslfilename, client_t *client);
+void xslt_transform(xmlDocPtr doc, const char *xslfilename, client_t *client);
void xslt_initialize();
void xslt_shutdown();
Modified: icecast/branches/kh/icecast/web/status.xsl
===================================================================
--- icecast/branches/kh/icecast/web/status.xsl 2004-09-19 19:30:20 UTC (rev 7801)
+++ icecast/branches/kh/icecast/web/status.xsl 2004-09-19 19:38:09 UTC (rev 7802)
@@ -7,19 +7,22 @@
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body bgcolor="black">
-<table border="0" width="100%%">
+<table border="0" width="100%">
<tr>
<td width="50"></td>
+<td> <h2>Icecast Status Page</h2> </td>
+</tr>
+<xsl:for-each select="source">
+<xsl:choose>
+<xsl:when test="listeners">
+<tr>
+<td width="50"></td>
<td>
-<h2>Icecast Status Page</h2>
<div class="roundcont">
<div class="roundtop">
<img src="corner_topleft.jpg" class="corner" style="display: none" />
</div>
<div class="newscontent">
-<xsl:for-each select="source">
-<xsl:choose>
-<xsl:when test="listeners">
<h3>
<xsl:if test="server_name"><xsl:value-of select="server_name" /> </xsl:if>
(<xsl:value-of select="@mount" />)
@@ -60,22 +63,15 @@
</xsl:choose>
</td></tr>
</table>
-</xsl:when>
-<xsl:otherwise>
-<h3><xsl:value-of select="@mount" /> - Not Connected</h3>
-</xsl:otherwise>
-</xsl:choose>
-<br></br>
-<br></br>
-</xsl:for-each>
</div>
<div class="roundbottom">
<img src="corner_bottomleft.jpg" class="corner" style="display: none" />
</div>
</div>
-<br></br><br></br>
-</td>
-<td width="25"></td></tr>
+</td></tr>
+</xsl:when>
+</xsl:choose>
+</xsl:for-each>
</table>
<div class="poster"><img align="left" src="/icecast.png" />Support icecast development at <a class="nav" href="http://www.icecast.org">www.icecast.org</a></div>
</body>
Modified: icecast/branches/kh/icecast/web/style.css
===================================================================
--- icecast/branches/kh/icecast/web/style.css 2004-09-19 19:30:20 UTC (rev 7801)
+++ icecast/branches/kh/icecast/web/style.css 2004-09-19 19:38:09 UTC (rev 7802)
@@ -94,6 +94,7 @@
color: #FFFFFF;
}
.roundcont {
+ margin: 15px 0px;
width: 90%;
background-color: #656565;
color: #fff;
@@ -185,7 +186,7 @@
}
.roundbottom {
- background: url(corner_bottomright.jpg) no-repeat top right;
+ background: url(corner_bottomright.jpg) no-repeat bottom right;
}
img.corner {
More information about the commits
mailing list