Skip to content

Commit

Permalink
fix bug: There is no memory overflow caused by timer sending data FD.
Browse files Browse the repository at this point in the history
  • Loading branch information
huangchunhua committed Apr 1, 2020
1 parent cd1ec62 commit 5105c33
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions evio_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ func (l *loop) SendData(fd int, out []byte) {
}
}
} else {
if l.fdconns[fd] == nil {
return
}
l.fdconns[fd].out = append(l.fdconns[fd].out, out...)
if len(l.fdconns[fd].out) != 0 || l.fdconns[fd].action != None {
l.poll.ModReadWrite(fd)
Expand Down

0 comments on commit 5105c33

Please sign in to comment.