mirror of https://github.com/schollz/croc.git
small fix
This commit is contained in:
parent
48819a9e03
commit
9f6936e1ff
|
@ -69,7 +69,7 @@ func (c *Comm) Read() (buf []byte, numBytes int, bs []byte, err error) {
|
||||||
var header []byte
|
var header []byte
|
||||||
numBytes = 4
|
numBytes = 4
|
||||||
for {
|
for {
|
||||||
tmp := make([]byte,numBytes-len(header))
|
tmp := make([]byte, numBytes-len(header))
|
||||||
n, errRead := c.connection.Read(tmp)
|
n, errRead := c.connection.Read(tmp)
|
||||||
if errRead != nil {
|
if errRead != nil {
|
||||||
err = errRead
|
err = errRead
|
||||||
|
@ -88,6 +88,7 @@ func (c *Comm) Read() (buf []byte, numBytes int, bs []byte, err error) {
|
||||||
fmt.Println("binary.Read failed:", err)
|
fmt.Println("binary.Read failed:", err)
|
||||||
}
|
}
|
||||||
numBytes = int(numBytesUint32)
|
numBytes = int(numBytesUint32)
|
||||||
|
buf = make([]byte, 0)
|
||||||
for {
|
for {
|
||||||
// log.Debugf("bytes: %d/%d",len(buf),numBytes)
|
// log.Debugf("bytes: %d/%d",len(buf),numBytes)
|
||||||
tmp := make([]byte, numBytes-len(buf))
|
tmp := make([]byte, numBytes-len(buf))
|
||||||
|
|
Loading…
Reference in New Issue