mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
fix when if buffer is not aligned
This commit is contained in:
parent
97575e7185
commit
865a017936
|
@ -129,11 +129,10 @@ func GetBufferStream(url string, values url.Values, allocatedBytes []byte, eachB
|
||||||
if r.StatusCode != 200 {
|
if r.StatusCode != 200 {
|
||||||
return fmt.Errorf("%s: %s", url, r.Status)
|
return fmt.Errorf("%s: %s", url, r.Status)
|
||||||
}
|
}
|
||||||
bufferSize := len(allocatedBytes)
|
|
||||||
for {
|
for {
|
||||||
n, err := r.Body.Read(allocatedBytes)
|
n, err := r.Body.Read(allocatedBytes)
|
||||||
if n == bufferSize {
|
if n > 0 {
|
||||||
eachBuffer(allocatedBytes)
|
eachBuffer(allocatedBytes[:n])
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err == io.EOF {
|
if err == io.EOF {
|
||||||
|
|
Loading…
Reference in a new issue