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

Michael Smith msmith at xiph.org
Sat Oct 5 07:53:10 PDT 2002



msmith      02/10/05 10:53:10

  Modified:    src      shout.c
  Log:
  shout_send_raw() was bug-riddled. Attempt to restore sanity.

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

Index: shout.c
===================================================================
RCS file: /usr/local/cvsroot/libshout/src/shout.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- shout.c	3 Oct 2002 23:48:45 -0000	1.11
+++ shout.c	5 Oct 2002 14:53:09 -0000	1.12
@@ -161,14 +161,14 @@
 
         while(remaining) {
                 ret = sock_write_bytes(self->socket, data, remaining);
-        if(ret < (ssize_t)remaining && errno == EINTR) {
-            remaining -= (remaining>0)?remaining:0;
+        if(ret < (ssize_t)remaining || errno == EINTR) {
+            remaining -= (ret>0)?ret:0;
             continue;
         }
-		if (ret < 0 || (size_t)ret != remaining) {
-			self->error = SHOUTERR_SOCKET;
-			return ret;
-		}
+        else if(ret < 0) {
+            self->error = SHOUTERR_SOCKET;
+            return -1;
+        }
         remaining = 0;
         }
 

<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