Merge pull request #48 from gbarr/large-packet-read
Avoid read channel corruption when response size > bufferSize
This commit is contained in:
commit
ccb6f4a24f
@ -104,6 +104,7 @@ ReadLoop:
|
|||||||
}
|
}
|
||||||
if len(leftdata) > 0 { // some data left for processing
|
if len(leftdata) > 0 { // some data left for processing
|
||||||
data = append(leftdata, data...)
|
data = append(leftdata, data...)
|
||||||
|
leftdata = nil
|
||||||
}
|
}
|
||||||
for {
|
for {
|
||||||
l := len(data)
|
l := len(data)
|
||||||
|
@ -5,7 +5,7 @@ const (
|
|||||||
// queue size
|
// queue size
|
||||||
queueSize = 8
|
queueSize = 8
|
||||||
// read buffer size
|
// read buffer size
|
||||||
bufferSize = 1024
|
bufferSize = 8192
|
||||||
// min packet length
|
// min packet length
|
||||||
minPacketLength = 12
|
minPacketLength = 12
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user