Merge pull request #65 from JessonChan/master

fixed #65
This commit is contained in:
Xing 2016-04-24 11:03:26 +12:00
commit 68777318f9

View File

@ -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:]
}
}
}
}
}