Преглед изворни кода

check the size of byte array, greater or lesser

tags/0.2
mikespook пре 11 година
родитељ
комит
fee531f9c1
1 измењених фајлова са 4 додато и 2 уклоњено
  1. +4
    -2
      worker/agent.go

+ 4
- 2
worker/agent.go Прегледај датотеку

@@ -139,12 +139,14 @@ func (a *agent) read() (data []byte, err error) {
l := int(common.BytesToUint32([4]byte{data[start+8],
data[start+9], data[start+10], data[start+11]}))
total := l + 12
if total == tl {
if total == tl { // data is what we want
return
} else {
} else if total < tl{ // data[:total] is what we want, data[total:] is the more
a.in <- data[total:]
data = data[:total]
return
} else { // ops!
break
}
} else {
start++


Loading…
Откажи
Сачувај