mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
fix to avoid loop
This commit is contained in:
parent
a37eca78cd
commit
2327c0756b
|
@ -74,10 +74,10 @@ func (fs *FilerServer) uploadReaderToChunks(w http.ResponseWriter, r *http.Reque
|
|||
lock.Unlock()
|
||||
// handle read errors
|
||||
if readErr != nil {
|
||||
if readErr != io.EOF {
|
||||
if err == nil {
|
||||
err = readErr
|
||||
}
|
||||
if readErr != io.EOF {
|
||||
resultsChan <- &ChunkCreationResult{
|
||||
err: readErr,
|
||||
}
|
||||
|
@ -86,6 +86,9 @@ func (fs *FilerServer) uploadReaderToChunks(w http.ResponseWriter, r *http.Reque
|
|||
}
|
||||
if len(data) == 0 {
|
||||
readErr = io.EOF
|
||||
if err == nil {
|
||||
err = readErr
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -120,6 +123,10 @@ func (fs *FilerServer) uploadReaderToChunks(w http.ResponseWriter, r *http.Reque
|
|||
|
||||
waitForAllData.Wait()
|
||||
|
||||
if err == io.EOF {
|
||||
err = nil
|
||||
}
|
||||
|
||||
return fileChunks, md5Hash, readOffset, err, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue