Added timeouts and checked for POLLRDHUP events

This commit is contained in:
Nate Choe
2022-01-29 16:37:54 -06:00
parent c46ed581c3
commit ab2e28ed10
11 changed files with 47 additions and 16 deletions

View File

@@ -91,7 +91,7 @@ error:
return NULL;
}
Stream *acceptStream(Listener *listener, int flags) {
Stream *acceptStream(Listener *listener) {
Stream *ret = malloc(sizeof(Stream));
if (ret == NULL)
return NULL;
@@ -126,10 +126,6 @@ Stream *acceptStream(Listener *listener, int flags) {
goto error;
break;
}
{
int flags = fcntl(ret->fd, F_GETFD);
fcntl(ret->fd, F_SETFD, flags | O_NONBLOCK);
}
return ret;
error:
close(ret->fd);