[xiph-cvs] cvs commit: libshout/src shout.c shout_private.h

Brendan brendan at xiph.org
Thu Feb 20 12:34:44 PST 2003



brendan     03/02/20 15:34:44

  Modified:    include/shout shout.h
               src      shout.c shout_private.h
  Log:
  The "ICE" protocol has been superseded by HTTP.

Revision  Changes    Path
1.14      +1 -2      libshout/include/shout/shout.h

Index: shout.h
===================================================================
RCS file: /usr/local/cvsroot/libshout/include/shout/shout.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- shout.h	6 Feb 2003 15:57:54 -0000	1.13
+++ shout.h	20 Feb 2003 20:34:44 -0000	1.14
@@ -22,10 +22,9 @@
 #define SHOUT_FORMAT_VORBIS	(0)
 #define SHOUT_FORMAT_MP3	(1)
 
-#define SHOUT_PROTOCOL_ICE		(0)
+#define SHOUT_PROTOCOL_HTTP		(0)
 #define SHOUT_PROTOCOL_XAUDIOCAST	(1)
 #define SHOUT_PROTOCOL_ICY		(2)
-#define SHOUT_PROTOCOL_HTTP		(3)
 
 typedef struct shout shout_t;
 typedef struct shout_metadata shout_metadata_t;

<p><p>1.23      +4 -53     libshout/src/shout.c

Index: shout.c
===================================================================
RCS file: /usr/local/cvsroot/libshout/src/shout.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- shout.c	11 Feb 2003 12:22:15 -0000	1.22
+++ shout.c	20 Feb 2003 20:34:44 -0000	1.23
@@ -14,7 +14,6 @@
 #include "httpp/httpp.h"
 
 /* -- local prototypes -- */
-static int login_ice(shout_t *self);
 static int login_xaudiocast(shout_t *self);
 static int login_icy(shout_t *self);
 static int login_http_basic(shout_t *self);
@@ -79,8 +78,7 @@
         if (!self->host || !self->password || !self->port || self->connected)
                 return self->error = SHOUTERR_INSANE;
 
-	if (self->format == SHOUT_FORMAT_VORBIS && 
-	    self->protocol != SHOUT_PROTOCOL_ICE && self->protocol != SHOUT_PROTOCOL_HTTP)
+	if (self->format == SHOUT_FORMAT_VORBIS && self->protocol != SHOUT_PROTOCOL_HTTP)
                 return self->error = SHOUTERR_UNSUPPORTED;
 
         if(self->protocol != SHOUT_PROTOCOL_HTTP) {
@@ -94,12 +92,6 @@
                         sock_close(self->socket);
                         return self->error;
                 }
-	}
-	else if (self->protocol == SHOUT_PROTOCOL_ICE) {
-		if ((self->error = login_ice(self)) != SHOUTERR_SUCCESS) {
-			sock_close(self->socket);
-			return self->error;
-		}
         } else if (self->protocol == SHOUT_PROTOCOL_XAUDIOCAST) {
                 if ((self->error = login_xaudiocast(self)) != SHOUTERR_SUCCESS) {
                         sock_close(self->socket);
@@ -741,10 +733,9 @@
         if (self->connected)
                 return self->error = SHOUTERR_CONNECTED;
 
-	if (protocol != SHOUT_PROTOCOL_ICE &&
+	if (protocol != SHOUT_PROTOCOL_HTTP &&
             protocol != SHOUT_PROTOCOL_XAUDIOCAST &&
-	    protocol != SHOUT_PROTOCOL_ICY &&
-	    protocol != SHOUT_PROTOCOL_HTTP)
+	    protocol != SHOUT_PROTOCOL_ICY)
                 return self->error = SHOUTERR_UNSUPPORTED;
 
         self->protocol = protocol;
@@ -787,7 +778,7 @@
                 if (!sock_write(self->socket, "ice-genre: %s\r\n", self->genre))
                         return SHOUTERR_SOCKET;
         }
-	if (!sock_write(self->socket, "ice-bitrate: %d\r\n", self->bitrate))
+	if (self->bitrate && !sock_write(self->socket, "ice-bitrate: %d\r\n", self->bitrate))
                 return SHOUTERR_SOCKET;
         if (!sock_write(self->socket, "ice-public: %d\r\n", self->public))
                 return SHOUTERR_SOCKET;
@@ -917,46 +908,6 @@
 
         httpp_destroy(parser);
         return self->error = SHOUTERR_REFUSED;
-}
-
-static int login_ice(shout_t *self)
-{
-	self->error = SHOUTERR_SOCKET;
-
-	if (!sock_write(self->socket, "SOURCE %s ICE/1.0\n", self->mount))
-		return SHOUTERR_SOCKET;
-	if (!sock_write(self->socket, "ice-password: %s\n", self->password))
-		return SHOUTERR_SOCKET;
-	if (!sock_write(self->socket, "ice-name: %s\n", self->name != NULL ? self->name : "no name"))
-		return SHOUTERR_SOCKET;
-	if (self->url) {
-		if (!sock_write(self->socket, "ice-url: %s\n", self->url))
-			return SHOUTERR_SOCKET;
-	}
-	if (self->genre) {
-		if (!sock_write(self->socket, "ice-genre: %s\n", self->genre))
-			return SHOUTERR_SOCKET;
-	}
-	if (!sock_write(self->socket, "ice-bitrate: %d\n", self->bitrate))
-		return SHOUTERR_SOCKET;
-	if (!sock_write(self->socket, "ice-public: %d\n", self->public))
-		return SHOUTERR_SOCKET;
-	if (self->description) {
-		if (!sock_write(self->socket, "ice-description: %s\n", self->description))
-			return SHOUTERR_SOCKET;
-	}
-	if (self->format == SHOUT_FORMAT_VORBIS) {
-		if (!sock_write(self->socket, "Content-Type: application/ogg\n"))
-			return SHOUTERR_SOCKET;
-	} else if (self->format == SHOUT_FORMAT_MP3) {
-		if (!sock_write(self->socket, "Content-Type: audio/mpeg\n"))
-			return SHOUTERR_SOCKET;
-	}
-
-	if (!sock_write(self->socket, "\n"))
-		return SHOUTERR_SOCKET;
-
-	return SHOUTERR_SUCCESS;
 }
 
 static int login_xaudiocast(shout_t *self)

<p><p>1.8       +1 -1      libshout/src/shout_private.h

Index: shout_private.h
===================================================================
RCS file: /usr/local/cvsroot/libshout/src/shout_private.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- shout_private.h	6 Feb 2003 15:57:54 -0000	1.7
+++ shout_private.h	20 Feb 2003 20:34:44 -0000	1.8
@@ -34,7 +34,7 @@
 #define LIBSHOUT_DEFAULT_HOST "localhost"
 #define LIBSHOUT_DEFAULT_PORT 8000
 #define LIBSHOUT_DEFAULT_FORMAT SHOUT_FORMAT_VORBIS
-#define LIBSHOUT_DEFAULT_PROTOCOL SHOUT_PROTOCOL_ICE
+#define LIBSHOUT_DEFAULT_PROTOCOL SHOUT_PROTOCOL_HTTP
 #define LIBSHOUT_DEFAULT_USER "source"
 #define LIBSHOUT_DEFAULT_USERAGENT "libshout/" VERSION
 

<p><p>--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list