[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

UPDATE: net/icecast (a friendly reminder ;-) )



Hi,


it seems that my update to net/icecast fell through the cracks, so here it is again, complete in one email. Instructions and the list of changes are contained within the patch.


For the sake of simplicity, the complete, updated port is also attached as a .tar.gz.

These attachments contain the original update I submitted (no further changes), as well as the fix for NSV streaming from the Icecast SVN trunk (again, no further changes either.)

Tested for about a month now on i386, please test elsewhere, comment and commit if OK... the usual. :-)


Thanks,

Moritz
This patch updates net/icecast to icecast-2.3.0. To update, apply this patch,
and remove
    patches/patch-src_admin_c
    patches/patch-src_auth_c
and add
    patches/patch-src_connection_c
 
Changes since 2.2.0 (details on www.icecast.org):
 
  New features:
    * Support Ogg Speex, Ogg FLAC, Ogg Midi
    * Intro file support
    * On-demand relays
    * Improved mount-level settings
    * URL listener authenticator
    * Authentication for on-demand files
    * Updated admin/web interface
    * Various reliability bug fixes

  Port changes:
    * Ogg Theora streaming is now enabled
    * Revamped README.OpenBSD file, tightened DESCR
    * <fileserve> directive not disabled any longer
      in icecast.xml.dist(*)

*: That was a custom change of the port with the intention to prevent
   people from accidentially fileserving. However, it makes the web
   interface ugly and doesn't really add to security (at least when
   people follow my README.OpenBSD.)

Index: Makefile
===================================================================
RCS file: /cvs/ports/net/icecast/Makefile,v
retrieving revision 1.30
diff -u -p -r1.30 Makefile
--- Makefile	23 Aug 2005 21:26:26 -0000	1.30
+++ Makefile	24 Sep 2005 15:21:48 -0000
@@ -2,8 +2,7 @@
 
 COMMENT=	"server for streaming Ogg Vorbis and MP3"
 
-DISTNAME=	icecast-2.2.0
-PKGNAME=	${DISTNAME}p2
+DISTNAME=	icecast-2.3.0
 CATEGORIES=	net audio
 
 HOMEPAGE=	http://www.icecast.org/
@@ -17,16 +16,18 @@ PERMIT_DISTFILES_CDROM=	Yes
 PERMIT_DISTFILES_FTP=	Yes
 WANTLIB=		c crypto iconv m ogg pthread ssl xml2 z
 
-MASTER_SITES=	http://downloads.us.xiph.org/releases/icecast/
+MASTER_SITES=	http://downloads.xiph.org/releases/icecast/
 
 CONFIGURE_STYLE= gnu
-CONFIGURE_ARGS+= --localstatedir=/var --without-theora
+CONFIGURE_ARGS+= --localstatedir=/var --with-theora=${LOCALBASE}
 CONFIGURE_ENV=	CPPFLAGS="-I${LOCALBASE}/include" \
 		LDFLAGS="-L${LOCALBASE}/lib"
 
 LIB_DEPENDS=	curl.2::net/curl \
 		xslt.3::textproc/libxslt \
-		vorbis.3::audio/libvorbis
+		vorbis.3::audio/libvorbis \
+		speex.3::audio/speex \
+		theora.1::multimedia/libtheora
 
 SEPARATE_BUILD=	simple
 
Index: distinfo
===================================================================
RCS file: /cvs/ports/net/icecast/distinfo,v
retrieving revision 1.7
diff -u -p -r1.7 distinfo
--- distinfo	5 Jan 2005 17:14:44 -0000	1.7
+++ distinfo	24 Sep 2005 15:21:48 -0000
@@ -1,4 +1,4 @@
-MD5 (icecast-2.2.0.tar.gz) = 7958347af55651384298828175e32dcf
-RMD160 (icecast-2.2.0.tar.gz) = 536ae6c658937e2b273ca218408056e69e26f798
-SHA1 (icecast-2.2.0.tar.gz) = 5cfd558b159517a55bdf99da8e5e5ebeca232a5e
-SIZE (icecast-2.2.0.tar.gz) = 702418
+MD5 (icecast-2.3.0.tar.gz) = 35256fbc4a93571662af2ed18fbbfcc5
+RMD160 (icecast-2.3.0.tar.gz) = 59ffe3fa53ef20d4a31c2d9ac3b73d2edc064911
+SHA1 (icecast-2.3.0.tar.gz) = 9210403649d178591d5f750bc88896352480ccb8
+SIZE (icecast-2.3.0.tar.gz) = 1091422
Index: files/README.OpenBSD
===================================================================
RCS file: /cvs/ports/net/icecast/files/README.OpenBSD,v
retrieving revision 1.2
diff -u -p -r1.2 README.OpenBSD
--- files/README.OpenBSD	31 Dec 2004 13:09:10 -0000	1.2
+++ files/README.OpenBSD	24 Sep 2005 15:21:48 -0000
@@ -1,8 +1,8 @@
 Icecast v2 is very versatile and can be used in many different setups.
-Because there is not "one true way" to install and configure it - every
-user will have his individual preferences and needs (a streaming service
+Since there is not "one true way" to install and configure it and every
+user will have individual preferences and needs. A streaming service
 provider has different requirements than someone who wants to set up a
-jukebox at home.)
+jukebox at home.
 
 To make things easier, here is a small step-by-step guide to get Icecast v2
 running in a basic setup, which uses its chrooting feature and drops
@@ -10,11 +10,14 @@ privileges to an unprivileged account.
 
   1. Read the documentation, so you know what you are doing. It is also
      very helpful to know what Icecast v2 is doing for you, and what it
-     is not.
+     is not. If you do not understand the concept of streaming with Icecast,
+     yet, http://liveice.sourceforge.net/understanding.html might be of use
+     to you.
 
   2. Create an unprivileged user _icecast - preferrably with an UID that
      does not conflict with other ports, system UIDs or regular users.
-     I suggest something between 200 and 499.
+     I suggest something between 200 and 499. This example uses the UID/
+     GID combo 400:
 
      # useradd -c "Icecast Server" -d /nonexistent -g =uid \
            -s /sbin/nologin -u 400 _icecast
@@ -35,40 +38,68 @@ privileges to an unprivileged account.
      # touch log/error.log log/access.log
      # chown _icecast:_icecast log/*.log
 
-  6. There is an icecast.xml.dist in /var/icecast - rename it and adjust it.
+  6. Complete the chroot environment with additional system files --
+     this is optional, but it allows YP directory listing (DNS lookups are
+     required for those) to work and the log files will contain correct
+     timestamps.
+
+     # mkdir /var/icecast/etc
+     # cp -p /etc/{hosts,localtime,resolv.conf} /var/icecast/etc
+
+  7. There is an icecast.xml.dist in /var/icecast - rename it and adjust it.
      Consult the documentation and comments about the various options.
      Important settings for this particular setup are outlined below.
 
      # mv icecast.xml.dist icecast.xml
      # chmod 600 icecast.xml
      (Mode 600 is highly recommended; icecast.xml contains plain-text
-     passwords.)
+     passwords. At least keep it inaccessible to "others".)
 
      Now load icecast.xml in your favorite editor, and:
 
-     Change <basedir> to /var/icecast
+     * CHANGE THE DEFAULT PASSWORDS FOR SOURCE CLIENTS, RELAYS AND
+       THE ADMIN INTERFACE
 
-     Change <logdir> to /log
-     Change <webroot> to /web
-     Change <adminroot> to /admin
+     * Change <basedir> to /var/icecast
 
-     Change <chroot> to 1
-     Uncomment the <changeowner> directive, replace "nobody" and "nogroup"
-         with "_icecast", respectively
+     * Change <logdir> to /log
+     * Change <webroot> to /web
+     * Change <adminroot> to /admin
 
-  7. Start Icecast and monitor error.log for errors and clues on how to
+     * Change <chroot> to 1
+     * Uncomment the <changeowner> directive, replace both "nobody" and
+       "nogroup" with "_icecast".
+
+  8. Start Icecast and monitor error.log for errors and clues on how to
      solve any issues.
 
      # icecast -c /var/icecast/icecast.xml
 
-  8. Connect to the server with a source client and have fun. There are
-     many different source clients available for different platforms.
-     *nix users may find Ices0 to stream MP3, and Ices2 to stream Ogg Vorbis
-     useful. For WinAMP and XMMS there is Oddcast DSP on
-     http://www.oddsock.org/
-     Remember to give your mountpoint a proper name - MP3 streams should
-     use no extension, Ogg Vorbis streams should use .ogg, so that dumb or
-     broken players can send the stream to the appropriate decoder.
-     For starters, you should let the source client set the mountpoint;
-     pre-defined mountpoints are an advanced feature and not necessary
-     for basic streaming.
+     If things look good, add the command line parameter `-b' to send
+     Icecast into daemon land.
+
+  9. Test your server.
+     Use a source client to create a stream and listen to it with your
+     favorite player that supports streaming.
+     Also test Icecast's web interface. Be aware that Icecast sends
+     everything located in <webroot> to those who request it like a regular
+     (basic) web server. You can restrict this behavior to serve only
+     .xsl files by setting <fileserve> to 0 in your icecast.xml, however,
+     you should definitely take a closer look at what you actually want
+     to show the world here. There is no reason for paranoia, it's all
+     safe, but you should spend some time thinking about it. Note that
+     disabling <fileserve> will also prevent CSS stylesheets and images
+     from being sent, making the web interface less pleasant to look at.
+
+
+  Random hints:
+
+     * Remember to give your mountpoint a proper name -- MP3 streams should
+       use no extension, Ogg Vorbis streams should use .ogg, so that dumb or
+       broken players can send the stream to the appropriate decoder.
+
+     * There are many different source clients available for different
+       platforms. On OpenBSD, there are at least the ices-0 and ices-2
+       packages available to stream MP3 and Ogg Vorbis audio respectively.
+       There are a lot more alternatives available that are easy to find
+       with a search engine like Google.
Index: patches/patch-Makefile_in
===================================================================
RCS file: /cvs/ports/net/icecast/patches/patch-Makefile_in,v
retrieving revision 1.2
diff -u -p -r1.2 patch-Makefile_in
--- patches/patch-Makefile_in	31 Dec 2004 13:09:10 -0000	1.2
+++ patches/patch-Makefile_in	24 Sep 2005 15:21:48 -0000
@@ -1,7 +1,7 @@
 $OpenBSD: patch-Makefile_in,v 1.2 2004/12/31 13:09:10 sturm Exp $
---- Makefile.in.orig	Tue Dec 21 21:09:16 2004
-+++ Makefile.in	Tue Dec 21 21:09:48 2004
-@@ -133,7 +133,7 @@ EXTRA_DIST = HACKING m4/acx_pthread.m4 m
+--- Makefile.in.orig	Sat Aug 20 21:36:59 2005
++++ Makefile.in	Tue Aug 23 11:30:09 2005
+@@ -137,7 +137,7 @@ EXTRA_DIST = HACKING m4/acx_pthread.m4 m
  
  
  docdir = $(datadir)/doc/$(PACKAGE)
Index: patches/patch-conf_Makefile_in
===================================================================
RCS file: /cvs/ports/net/icecast/patches/patch-conf_Makefile_in,v
retrieving revision 1.2
diff -u -p -r1.2 patch-conf_Makefile_in
--- patches/patch-conf_Makefile_in	31 Dec 2004 13:09:10 -0000	1.2
+++ patches/patch-conf_Makefile_in	24 Sep 2005 15:21:48 -0000
@@ -1,16 +1,16 @@
 $OpenBSD: patch-conf_Makefile_in,v 1.2 2004/12/31 13:09:10 sturm Exp $
---- conf/Makefile.in.orig	Tue Dec 21 21:11:36 2004
-+++ conf/Makefile.in	Tue Dec 21 21:12:36 2004
-@@ -126,7 +126,7 @@ AUTOMAKE_OPTIONS = foreign
- EXTRA_DIST = icecast.xml.in icecast_minimal.xml.in icecast_shoutcast_compat.xml.in
- DISTCLEANFILES = icecast.xml.dist icecast_minimal.xml.dist icecast_shoutcast_compat.xml.dist
+--- conf/Makefile.in.orig	Tue Aug 23 11:30:19 2005
++++ conf/Makefile.in	Tue Aug 23 11:31:07 2005
+@@ -130,7 +130,7 @@ AUTOMAKE_OPTIONS = foreign
+ EXTRA_DIST = icecast.xml.in icecast_minimal.xml.in icecast_shoutcast_compat.xml.in icecast_urlauth.xml.in
+ DISTCLEANFILES = icecast.xml.dist icecast_minimal.xml.dist icecast_shoutcast_compat.xml.dist icecast_urlauth.xml.dist
  
 -docdir = $(datadir)/$(PACKAGE)/doc
 +docdir = $(datadir)/examples/$(PACKAGE)
- doc_DATA = icecast.xml.dist icecast_minimal.xml.dist icecast_shoutcast_compat.xml.dist
+ doc_DATA = icecast.xml.dist icecast_minimal.xml.dist icecast_shoutcast_compat.xml.dist icecast_urlauth.xml.dist
  
  edit = sed -e 's,@pkgdatadir\@,$(pkgdatadir),g' \
-@@ -256,7 +256,6 @@ info-am:
+@@ -260,7 +260,6 @@ info-am:
  
  install-data-am: install-docDATA
  	@$(NORMAL_INSTALL)
Index: patches/patch-conf_icecast_xml_in
===================================================================
RCS file: /cvs/ports/net/icecast/patches/patch-conf_icecast_xml_in,v
retrieving revision 1.3
diff -u -p -r1.3 patch-conf_icecast_xml_in
--- patches/patch-conf_icecast_xml_in	16 Apr 2005 15:37:31 -0000	1.3
+++ patches/patch-conf_icecast_xml_in	24 Sep 2005 15:21:48 -0000
@@ -1,16 +1,7 @@
 $OpenBSD: patch-conf_icecast_xml_in,v 1.3 2005/04/16 15:37:31 sturm Exp $
---- conf/icecast.xml.in.orig	Thu Dec  2 22:15:35 2004
-+++ conf/icecast.xml.in	Mon Mar  7 20:20:46 2005
-@@ -100,7 +100,7 @@
-     </mount>
-     -->
- 
--    <fileserve>1</fileserve>
-+    <fileserve>0</fileserve>
- 
-     <!-- set the mountpoint for a shoutcast source to use, the default if not
-          specified is /stream but you can change it here if an alternative is
-@@ -117,7 +117,7 @@
+--- conf/icecast.xml.in.orig	Thu Sep  8 16:03:51 2005
++++ conf/icecast.xml.in	Sat Sep 24 15:23:12 2005
+@@ -139,7 +139,7 @@
          <logdir>@localstatedir@/log/@PACKAGE@</logdir>
          <webroot>@pkgdatadir@/web</webroot>
          <adminroot>@pkgdatadir@/admin</adminroot>
Index: patches/patch-doc_Makefile_in
===================================================================
RCS file: /cvs/ports/net/icecast/patches/patch-doc_Makefile_in,v
retrieving revision 1.2
diff -u -p -r1.2 patch-doc_Makefile_in
--- patches/patch-doc_Makefile_in	16 Apr 2005 15:37:31 -0000	1.2
+++ patches/patch-doc_Makefile_in	24 Sep 2005 15:21:48 -0000
@@ -1,7 +1,7 @@
 $OpenBSD: patch-doc_Makefile_in,v 1.2 2005/04/16 15:37:31 sturm Exp $
---- doc/Makefile.in.orig	Tue Dec 21 20:31:03 2004
-+++ doc/Makefile.in	Mon Mar  7 20:20:46 2005
-@@ -123,7 +123,7 @@ install_sh = @install_sh@
+--- doc/Makefile.in.orig	Sat Aug 20 21:36:59 2005
++++ doc/Makefile.in	Tue Aug 23 11:30:10 2005
+@@ -127,7 +127,7 @@ install_sh = @install_sh@
  
  AUTOMAKE_OPTIONS = foreign
  
Index: patches/patch-src_util_c
===================================================================
RCS file: /cvs/ports/net/icecast/patches/patch-src_util_c,v
retrieving revision 1.3
diff -u -p -r1.3 patch-src_util_c
--- patches/patch-src_util_c	23 Aug 2005 21:26:27 -0000	1.3
+++ patches/patch-src_util_c	24 Sep 2005 15:21:48 -0000
@@ -1,6 +1,6 @@
-$OpenBSD: patch-src_util_c,v 1.3 2005/08/23 21:26:27 pvalchev Exp $
---- src/util.c.orig	Mon Nov  8 02:21:54 2004
-+++ src/util.c	Tue Aug 23 13:58:40 2005
+$OpenBSD: patch-src_util_c,v 1.2 2005/04/16 21:24:15 sturm Exp $
+--- src/util.c.orig	Fri Aug 19 04:01:58 2005
++++ src/util.c	Tue Aug 23 14:12:44 2005
 @@ -229,12 +229,22 @@ char *util_get_path_from_normalised_uri(
      char *fullpath;
      char *webroot;
@@ -27,7 +27,7 @@ $OpenBSD: patch-src_util_c,v 1.3 2005/08
      config_release_config();
  
      return fullpath;
-@@ -568,24 +578,40 @@ char *util_dict_urlencode(util_dict *dic
+@@ -572,24 +582,40 @@ char *util_dict_urlencode(util_dict *dic
      char *res, *tmp;
      char *enc;
      int start = 1;
@@ -73,7 +73,7 @@ $OpenBSD: patch-src_util_c,v 1.3 2005/08
          }
  
          /* encode value */
-@@ -596,14 +622,25 @@ char *util_dict_urlencode(util_dict *dic
+@@ -600,14 +626,25 @@ char *util_dict_urlencode(util_dict *dic
              return NULL;
          }
  
Index: patches/patch-src_yp_c
===================================================================
RCS file: /cvs/ports/net/icecast/patches/patch-src_yp_c,v
retrieving revision 1.2
diff -u -p -r1.2 patch-src_yp_c
--- patches/patch-src_yp_c	16 Apr 2005 21:24:15 -0000	1.2
+++ patches/patch-src_yp_c	24 Sep 2005 15:21:48 -0000
@@ -1,24 +1,15 @@
 $OpenBSD: patch-src_yp_c,v 1.2 2005/04/16 21:24:15 sturm Exp $
---- src/yp.c.orig	Fri Dec 17 20:01:26 2004
-+++ src/yp.c	Sat Apr 16 23:11:10 2005
-@@ -315,6 +315,8 @@ static unsigned do_yp_remove (ypdata_t *
-         int ret = snprintf (s, len, "action=remove&sid=%s", yp->sid);
-         if (ret >= (signed)len)
-             return ret+1;
-+        if (ret == -1)
-+            ERROR0("snprintf()");
- 
-         INFO1 ("clearing up YP entry for %s", yp->mount);
-         send_to_yp ("remove", yp, s);
-@@ -365,6 +367,7 @@ static unsigned do_yp_touch (ypdata_t *y
-     char *val, *artist, *title;
-     int ret;
-     char *max_listeners;
-+    size_t songlen;
- 
-     artist = (char *)stats_get_value (yp->mount, "artist");
-     title = (char *)stats_get_value (yp->mount, "title");
-@@ -378,11 +381,15 @@ static unsigned do_yp_touch (ypdata_t *y
+--- src/yp.c.orig	Tue Aug 23 11:58:42 2005
++++ src/yp.c	Tue Aug 23 12:10:43 2005
+@@ -398,6 +398,7 @@ static unsigned do_yp_touch (ypdata_t *y
+     if (artist || title)
+     {
+          char *song;
++         size_t songlen;
+          char *separator = " - ";
+          if (artist == NULL)
+          {
+@@ -405,10 +406,13 @@ static unsigned do_yp_touch (ypdata_t *y
               separator = "";
           }
           if (title == NULL) title = strdup("");
@@ -28,21 +19,9 @@ $OpenBSD: patch-src_yp_c,v 1.2 2005/04/1
           if (song)
           {
 -             sprintf (song, "%s%s%s", artist, separator, title);
--             add_yp_info(yp, "yp_currently_playing", song, YP_CURRENT_SONG);
-+             int ret = snprintf(song, songlen, "%s%s%s", artist, separator, title);
-+             if (ret == -1 || ret >= songlen)
-+                 WARN0("Error, generating song title");
-+             else
-+                 add_yp_info(yp, "yp_currently_playing", song, YP_CURRENT_SONG);
++             ret = snprintf (song, len, "%s%s%s", artist, separator, title);
++             if (ret == -1 || ret >= (signed)songlen)
++                 ERROR0 ("snprintf() in do_yp_touch()");
+              add_yp_info(yp, song, YP_CURRENT_SONG);
+              stats_event (yp->mount, "yp_currently_playing", song);
               free (song);
-          }
-     }
-@@ -415,6 +422,8 @@ static unsigned do_yp_touch (ypdata_t *y
-     free (max_listeners);
-     if (ret >= (signed)len)
-         return ret+1; /* space required for above text and nul*/
-+    if (ret == -1)
-+        WARN0("snprintf()");
- 
-     send_to_yp ("touch", yp, s);
-     return 0;
Index: pkg/DESCR
===================================================================
RCS file: /cvs/ports/net/icecast/pkg/DESCR,v
retrieving revision 1.5
diff -u -p -r1.5 DESCR
--- pkg/DESCR	31 Dec 2004 13:09:10 -0000	1.5
+++ pkg/DESCR	24 Sep 2005 15:21:48 -0000
@@ -1,26 +1,8 @@
-Icecast is a streaming media server which currently supports Ogg
-Vorbis and MP3 audio streams. It can be used to create an Internet
-radio station or a privately running jukebox and many things in
-between. It is very versatile in that new formats can be added
-relatively easily and supports open standards for communication and
-interaction.
+Icecast is a streaming media server which currently supports Ogg-based
+streams like Vorbis, Speex, FLAC, Midi and Theora, as well as MP3 and various
+others (even NSV Shoutcast streams). It can be used to create an Internet
+radio station or a privately run jukebox and many things inbetween. It is very
+versatile and supports open standards for communication and interaction.
 
 Icecast v2 is a complete rewrite of the old Icecast streaming server.
 It was designed to be highly efficient and have low memory requirements.
-
-Additional features are, among others:
-
-   * a web-based administration interface including simple file serving
-     (disabled by default on OpenBSD) - seeking in such served files is
-     possible
-   * supports listing in stream directories
-   * new relay system
-   * listener authentication
-   * multi-level fallbacks
-   * "burst-on-connect" to significantly reduce buffering latency on the
-     client side
-   * Shoutcast-style client support (allows use of Shoutcast DSP and
-     NSV support using their native tools)
-
-Security features include chroot()ing and dropping privileges, if
-configured to do so.
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/net/icecast/pkg/PLIST,v
retrieving revision 1.7
diff -u -p -r1.7 PLIST
--- pkg/PLIST	31 Dec 2004 13:09:10 -0000	1.7
+++ pkg/PLIST	24 Sep 2005 15:21:48 -0000
@@ -6,6 +6,7 @@ share/doc/icecast/NEWS
 share/doc/icecast/README.OpenBSD
 share/doc/icecast/icecast2_admin.html
 share/doc/icecast/icecast2_basicsetup.html
+share/doc/icecast/icecast2_changes.html
 share/doc/icecast/icecast2_config_file.html
 share/doc/icecast/icecast2_faq.html
 share/doc/icecast/icecast2_glossary.html
@@ -16,6 +17,9 @@ share/doc/icecast/icecast2_stats.html
 share/doc/icecast/icecast2_win32.html
 share/doc/icecast/icecast2_yp.html
 share/doc/icecast/index.html
+share/doc/icecast/listener_auth1.jpg
+share/doc/icecast/listener_auth2.jpg
+share/doc/icecast/listener_auth3.jpg
 share/examples/icecast/
 share/examples/icecast/admin/
 share/examples/icecast/admin/listclients.xsl
@@ -28,6 +32,7 @@ share/examples/icecast/admin/updatemetad
 share/examples/icecast/icecast.xml.dist
 share/examples/icecast/icecast_minimal.xml.dist
 share/examples/icecast/icecast_shoutcast_compat.xml.dist
+share/examples/icecast/icecast_urlauth.xml.dist
 share/examples/icecast/web/
 share/examples/icecast/web/auth.xsl
 share/examples/icecast/web/corner_bottomleft.jpg
@@ -36,6 +41,9 @@ share/examples/icecast/web/corner_toplef
 share/examples/icecast/web/corner_topright.jpg
 share/examples/icecast/web/icecast.png
 share/examples/icecast/web/key.gif
+share/examples/icecast/web/key.png
+share/examples/icecast/web/server_version.xsl
 share/examples/icecast/web/status.xsl
 share/examples/icecast/web/status2.xsl
 share/examples/icecast/web/style.css
+share/examples/icecast/web/tunein.png
$OpenBSD$
--- src/connection.c.orig	Mon Sep 26 22:54:02 2005
+++ src/connection.c	Mon Sep 26 19:21:07 2005
@@ -872,7 +872,7 @@ static void _handle_shoutcast_compatible
 
     if (node->shoutcast == 1)
     {
-        char *source_password, *ptr;
+        char *source_password, *ptr, *headers;
         mount_proxy *mountinfo = config_find_mount (config, config->shoutcast_mount);
 
         if (mountinfo && mountinfo->password)
@@ -883,8 +883,14 @@ static void _handle_shoutcast_compatible
 
         /* Get rid of trailing \r\n or \n after password */
         ptr = strstr (client->refbuf->data, "\r\n");
-        if (ptr == NULL)
+        if (ptr)
+            headers = ptr+2;
+        else
+        {
             ptr = strstr (client->refbuf->data, "\n");
+            if (ptr)
+                headers = ptr+1;
+        }
 
         if (ptr == NULL)
         {
@@ -901,9 +907,9 @@ static void _handle_shoutcast_compatible
             /* send this non-blocking but if there is only a partial write
              * then leave to header timeout */
             sock_write (client->con->sock, "OK2\r\n");
-            memset (client->refbuf->data, 0, client->refbuf->len);
+            node->offset -= (headers - client->refbuf->data);
+            memmove (client->refbuf->data, headers, node->offset+1);
             node->shoutcast = 2;
-            node->offset = 0;
             /* we've checked the password, now send it back for reading headers */
             _add_request_queue (node);
             free (source_password);

Attachment: icecast-port-2.3.0.tar.gz
Description: application/gzip


Visit your host, monkey.org