Fixed bug in accept, added tests for it and for connect with timeout.
This commit is contained in:
parent
51fcb5a7bd
commit
87e8737218
2 changed files with 52 additions and 11 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue