Slight interface simplification

This commit is contained in:
Ian Gulliver
2019-05-04 07:57:55 +00:00
parent c1b0a1dcce
commit 95e9eb0c51
3 changed files with 7 additions and 12 deletions

View File

@@ -62,8 +62,9 @@ void FastCGIServer::Serve() {
NewConn();
} else {
auto conn = static_cast<FastCGIConn*>(events[i].data.ptr);
if (!conn->Read()) {
PCHECK(epoll_ctl(epoll_fd_, EPOLL_CTL_DEL, conn->Sock(), nullptr) == 0);
auto fd = conn->Read();
if (fd != -1) {
PCHECK(epoll_ctl(epoll_fd_, EPOLL_CTL_DEL, fd, nullptr) == 0);
delete conn;
}
}