Commit 87406865 authored by brendan's avatar brendan
Browse files

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.

svn path=/icecast/trunk/libshout/; revision=8807
parent d879ed16
...@@ -65,10 +65,8 @@ int main() ...@@ -65,10 +65,8 @@ int main()
ret = shout_open(shout); ret = shout_open(shout);
if (ret == SHOUTERR_SUCCESS) if (ret == SHOUTERR_SUCCESS)
ret = SHOUTERR_CONNECTED; ret = SHOUTERR_CONNECTED;
else if (ret == SHOUTERR_BUSY)
ret = SHOUTERR_UNCONNECTED;
while (ret == SHOUTERR_UNCONNECTED) { while (ret == SHOUTERR_BUSY) {
printf("Connection pending. Sleeping...\n"); printf("Connection pending. Sleeping...\n");
sleep(1); sleep(1);
ret = shout_get_connected(shout); ret = shout_get_connected(shout);
......
...@@ -390,9 +390,7 @@ int shout_get_connected(shout_t *self) ...@@ -390,9 +390,7 @@ int shout_get_connected(shout_t *self)
if (self->state != SHOUT_STATE_UNCONNECTED) { if (self->state != SHOUT_STATE_UNCONNECTED) {
if ((rc = try_connect(self)) == SHOUTERR_SUCCESS) if ((rc = try_connect(self)) == SHOUTERR_SUCCESS)
return SHOUTERR_CONNECTED; return SHOUTERR_CONNECTED;
if (rc == SHOUTERR_BUSY) return rc;
return SHOUTERR_UNCONNECTED;
else return rc;
} }
return SHOUTERR_UNCONNECTED; return SHOUTERR_UNCONNECTED;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment