[xiph-commits] r7355 - icecast/trunk/libshout/src

brendan at dactyl.lonelymoon.com brendan
Mon Jul 26 13:11:40 PDT 2004


Author: brendan
Date: Mon Jul 26 13:11:40 2004
New Revision: 7355

Modified:
icecast/trunk/libshout/src/shout.c
Log:
Bug fixes for nonblocking connect.


Modified: icecast/trunk/libshout/src/shout.c
===================================================================
--- icecast/trunk/libshout/src/shout.c	2004-07-26 19:22:36 UTC (rev 7354)
+++ icecast/trunk/libshout/src/shout.c	2004-07-26 20:11:39 UTC (rev 7355)
@@ -861,9 +861,9 @@

rc = sock_read_bytes(self->socket, buf, sizeof(buf));

-	if (rc < 0 && sock_recoverable(rc))
+	if (rc < 0 && sock_recoverable(errno))
return SHOUTERR_BUSY;
-	if (!rc)
+	if (rc <= 0)
return SHOUTERR_SOCKET;

if ((rc = queue_data(&self->rqueue, buf, rc)))
@@ -922,8 +922,12 @@

case SHOUT_STATE_CONNECT_PENDING:
if (shout_get_nonblocking(self)) {
-			if (!sock_connected(self->socket, 0))
-				return SHOUTERR_BUSY;
+			if ((rc = sock_connected(self->socket, 0)) < 1) {
+				if (!rc)
+					return SHOUTERR_BUSY;
+				else
+					return SHOUTERR_SOCKET;
+			}
if ((rc = create_request(self)) != SHOUTERR_SUCCESS)
return rc;
}



More information about the commits mailing list