Skip to content

Commit

Permalink
fix bug: out in send data
Browse files Browse the repository at this point in the history
add: .gitignore
  • Loading branch information
Lfengjie committed Mar 31, 2020
1 parent 65d4e1b commit cd1ec62
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea
6 changes: 3 additions & 3 deletions evio_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,16 @@ type loop struct {
count int32 // connection count
}

func (l *loop) SendData (fd int, out []byte) {
func (l *loop) SendData(fd int, out []byte) {
if fd == SendAllClient {
for _, v := range l.fdconns {
v.out = append([]byte{}, out...)
v.out = append(v.out, out...)
if len(v.out) != 0 || v.action != None {
l.poll.ModReadWrite(v.fd)
}
}
} else {
l.fdconns[fd].out = append([]byte{}, out...)
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 cd1ec62

Please sign in to comment.