Skip to content

Commit

Permalink
fix: dont check epollout when epollerr (#183)
Browse files Browse the repository at this point in the history
  • Loading branch information
joway committed Aug 12, 2022
1 parent 4c6b739 commit 063c3c4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions poll_default_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,11 @@ func (p *defaultPoll) handler(events []epollevent) (closed bool) {
// So here we need to check this error, if it is EAGAIN then do nothing, otherwise still mark as hup.
if _, _, _, _, err := syscall.Recvmsg(operator.FD, nil, nil, syscall.MSG_ERRQUEUE); err != syscall.EAGAIN {
p.appendHup(operator)
continue
} else {
operator.done()
}
continue
}

// check poll out
if evt&syscall.EPOLLOUT != 0 {
if operator.OnWrite != nil {
Expand Down
4 changes: 3 additions & 1 deletion poll_race_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,10 @@ func (p *defaultPoll) handler(events []syscall.EpollEvent) (closed bool) {
// So here we need to check this error, if it is EAGAIN then do nothing, otherwise still mark as hup.
if _, _, _, _, err := syscall.Recvmsg(operator.FD, nil, nil, syscall.MSG_ERRQUEUE); err != syscall.EAGAIN {
p.appendHup(operator)
continue
} else {
operator.done()
}
continue
}

// check poll out
Expand Down

0 comments on commit 063c3c4

Please sign in to comment.