Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion event/poll.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,19 @@ int iowatcher_poll_events(hloop_t* loop, int timeout) {
++nevents;
hio_t* io = loop->ios.ptr[fd];
if (io) {
if (revents & POLLIN) {
//20200227 bugfix by song
//when peer close the connection,pool will capture POLLHUP event,we must process it avoid Infinite looping.
//refrence to https://github.com/RPCS3/rpcs3/blob/master/rpcs3/Emu/Cell/lv2/sys_net.cpp
if (revents & (POLLIN | POLLHUP)) {
io->revents |= READ_EVENT;
}
if (revents & POLLOUT) {
io->revents |= WRITE_EVENT;
}
if (revents & POLLERR) {
io->revents |= READ_EVENT;
io->revents |= WRITE_EVENT;
}
EVENT_PENDING(io);
}
}
Expand Down