Fixed bug in accept, added tests for it and for connect with timeout.

This commit is contained in:
Diego Nehab 2004-01-18 05:35:56 +00:00
parent 51fcb5a7bd
commit 87e8737218
2 changed files with 52 additions and 11 deletions

View file

@ -259,6 +259,7 @@ const char *inet_tryaccept(p_sock ps, p_tm tm, p_sock pc)
/* loop until connection accepted or timeout happens */
do err = sock_accept(ps, pc, (SA *) &addr, &addr_len, tm_getretry(tm));
while (err == IO_RETRY && tm_getretry(tm) != 0);
if (err == IO_RETRY) err = IO_TIMEOUT;
return io_strerror(err);
}