1
0
mirror of https://gitlab.xiph.org/xiph/icecast-common.git synced 2024-11-03 04:17:20 -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 /* see if a connection has been established
** return -1 for failure * return SOCK_TIMEOUT for timeout
** return 0 for not yet * return SOCK_ERROR for failure
** return 1 for ok * return 0 for try again, interrupted
*/ * return 1 for ok
*/
int sock_connected (int sock, unsigned timeout) int sock_connected (int sock, unsigned timeout)
{ {
fd_set wfds; fd_set wfds;
@ -480,7 +481,9 @@ int sock_connected (int sock, unsigned timeout)
{ {
if (val == 0) if (val == 0)
return 1; return 1;
sock_set_error (val);
} }
/* fall through */
case -1: case -1:
if (sock_recoverable (sock_error())) if (sock_recoverable (sock_error()))
return 0; return 0;