Skip to content

Commit

Permalink
Merge pull request #65 from JessonChan/master
Browse files Browse the repository at this point in the history
fixed #65
  • Loading branch information
mikespook committed Apr 23, 2016
2 parents 21cc8de + 99c8032 commit 6877731
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions worker/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,22 @@ func (a *agent) work() {
leftdata = data
continue
}
if inpack, l, err = decodeInPack(data); err != nil {
a.worker.err(err)
leftdata = data
continue
}
leftdata = nil
inpack.a = a
a.worker.in <- inpack
if len(data) > l {
leftdata = data[l:]
for {
if inpack, l, err = decodeInPack(data); err != nil {
a.worker.err(err)
leftdata = data
break
} else {
leftdata = nil
inpack.a = a
a.worker.in <- inpack
if len(data) == l {
break
}
if len(data) > l {
data = data[l:]
}
}
}
}
}
Expand Down

0 comments on commit 6877731

Please sign in to comment.