Browse Source

Merge pull request #48 from gbarr/large-packet-read

Avoid read channel corruption when response size > bufferSize
tags/0.2
Xing 9 years ago
parent
commit
ccb6f4a24f
2 changed files with 2 additions and 1 deletions
  1. +1
    -0
      client/client.go
  2. +1
    -1
      client/common.go

+ 1
- 0
client/client.go View File

@@ -104,6 +104,7 @@ ReadLoop:
}
if len(leftdata) > 0 { // some data left for processing
data = append(leftdata, data...)
leftdata = nil
}
for {
l := len(data)


+ 1
- 1
client/common.go View File

@@ -5,7 +5,7 @@ const (
// queue size
queueSize = 8
// read buffer size
bufferSize = 1024
bufferSize = 8192
// min packet length
minPacketLength = 12



Loading…
Cancel
Save