[xiph-commits] r8807 - in icecast/trunk/libshout: examples src
brendan at motherfish-iii.xiph.org
brendan at motherfish-iii.xiph.org
Sat Jan 29 11:38:43 PST 2005
Author: brendan
Date: 2005-01-29 11:38:42 -0800 (Sat, 29 Jan 2005)
New Revision: 8807
Modified:
icecast/trunk/libshout/examples/nonblocking.c
icecast/trunk/libshout/src/shout.c
Log:
Allow shout_get_connected to return SHOUTERR_BUSY if the socket is
non-blocking and the connection is pending. This makes it more
consistent with shout_open.
Modified: icecast/trunk/libshout/examples/nonblocking.c
===================================================================
--- icecast/trunk/libshout/examples/nonblocking.c 2005-01-29 18:26:48 UTC (rev 8806)
+++ icecast/trunk/libshout/examples/nonblocking.c 2005-01-29 19:38:42 UTC (rev 8807)
@@ -65,10 +65,8 @@
ret = shout_open(shout);
if (ret == SHOUTERR_SUCCESS)
ret = SHOUTERR_CONNECTED;
- else if (ret == SHOUTERR_BUSY)
- ret = SHOUTERR_UNCONNECTED;
- while (ret == SHOUTERR_UNCONNECTED) {
+ while (ret == SHOUTERR_BUSY) {
printf("Connection pending. Sleeping...\n");
sleep(1);
ret = shout_get_connected(shout);
Modified: icecast/trunk/libshout/src/shout.c
===================================================================
--- icecast/trunk/libshout/src/shout.c 2005-01-29 18:26:48 UTC (rev 8806)
+++ icecast/trunk/libshout/src/shout.c 2005-01-29 19:38:42 UTC (rev 8807)
@@ -390,9 +390,7 @@
if (self->state != SHOUT_STATE_UNCONNECTED) {
if ((rc = try_connect(self)) == SHOUTERR_SUCCESS)
return SHOUTERR_CONNECTED;
- if (rc == SHOUTERR_BUSY)
- return SHOUTERR_UNCONNECTED;
- else return rc;
+ return rc;
}
return SHOUTERR_UNCONNECTED;
More information about the commits
mailing list