mirror of
https://github.com/nadoo/glider.git
synced 2026-11-19 07:09:42 +08:00
1 parent
9eadb8d9f4
commit
a7d0421c93
15 files changed
+422
-171
No files matched your search
+3
-2
@@ -234,10 +234,11 @@ func (c *Client) exchangeTCP(rc net.Conn, reqBytes []byte) ([]byte, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var respLen uint16
|
||||
if err := binary.Read(rc, binary.BigEndian, &respLen); err != nil {
|
||||
var lenRaw [2]byte
|
||||
if _, err := io.ReadFull(rc, lenRaw[:]); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
respLen := binary.BigEndian.Uint16(lenRaw[:])
|
||||
|
||||
respBytes := pool.GetBuffer(int(respLen))
|
||||
_, err := io.ReadFull(rc, respBytes)
|
||||
|
||||
Reference in new issue
Block a user