1
0
mirror of https://gitlab.xiph.org/xiph/icecast-common.git synced 2024-12-04 14:46:31 -05:00

handle error condition at connection

svn path=/trunk/net/; revision=5833
This commit is contained in:
Karl Heyes 2004-02-17 14:17:57 +00:00
parent 5f34462604
commit 7bd73dfa33

View File

@ -448,11 +448,12 @@ int sock_read_line(sock_t sock, char *buff, const int len)
}
}
/* see if a connection can be written to
** return -1 for failure
** return 0 for not yet
** return 1 for ok
*/
/* see if a connection has been established
* return SOCK_TIMEOUT for timeout
* return SOCK_ERROR for failure
* return 0 for try again, interrupted
* return 1 for ok
*/
int sock_connected (int sock, unsigned timeout)
{
fd_set wfds;
@ -480,7 +481,9 @@ int sock_connected (int sock, unsigned timeout)
{
if (val == 0)
return 1;
sock_set_error (val);
}
/* fall through */
case -1:
if (sock_recoverable (sock_error()))
return 0;