Handle clients own disconnect and don't queue an UP and break if we haven't checked initial connection yet.
This commit is contained in:
@@ -111,8 +111,6 @@ void* run_endpoint(void* endpoint) {
|
||||
|
||||
self->sockfd = fd;
|
||||
self->last_errno = 0;
|
||||
queue_report((struct EndpointStatus){ self, UP, ping });
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,7 +142,7 @@ void* run_endpoint(void* endpoint) {
|
||||
}
|
||||
}
|
||||
|
||||
if (pfd.revents & (POLLERR | POLLHUP | POLLRDHUP)) {
|
||||
if ((pfd.revents & (POLLERR | POLLHUP | POLLRDHUP)) || pfd.events & POLLRDHUP) {
|
||||
close(self->sockfd);
|
||||
self->sockfd = -1;
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user