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

Brendan brendan at xiph.org
Fri Jul 4 21:41:10 PDT 2003



brendan     03/07/05 00:41:10

  Modified:    src      shout.c
  Log:
  Corrected some minor inconsistencies noted while writing documentation.

Revision  Changes    Path
1.44      +10 -6     libshout/src/shout.c

Index: shout.c
===================================================================
RCS file: /usr/local/cvsroot/libshout/src/shout.c,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -p -u -r1.43 -r1.44
--- shout.c	4 Jul 2003 23:18:26 -0000	1.43
+++ shout.c	5 Jul 2003 04:41:10 -0000	1.44
@@ -111,7 +111,10 @@ int shout_open(shout_t *self)
         if (!self)
                 return SHOUTERR_INSANE;
 
-	if (!self->host || !self->password || !self->port || self->connected)
+	if (self->connected)
+		return SHOUTERR_CONNECTED;
+
+	if (!self->host || !self->password || !self->port)
                 return self->error = SHOUTERR_INSANE;
 
         if (self->format == SHOUT_FORMAT_VORBIS && self->protocol != SHOUT_PROTOCOL_HTTP)
@@ -202,7 +205,10 @@ ssize_t shout_send_raw(shout_t *self, co
         size_t remaining = len;
 
         if (!self) 
-		return -1;
+		return SHOUTERR_INSANE;
+
+	if (!self->connected)
+		return SHOUTERR_UNCONNECTED;
 
         self->error = SHOUTERR_SUCCESS;
 
@@ -213,10 +219,8 @@ ssize_t shout_send_raw(shout_t *self, co
                 else if(ret < 0) {
                         if(errno == EINTR)
                                 ret = 0;
-			else {
-				self->error = SHOUTERR_SOCKET;
-				return -1;
-			}
+			else
+				return self->error = SHOUTERR_SOCKET;
                 }
                 remaining -= ret;
         }

<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