fix to avoid loop
This commit is contained in:
@@ -74,10 +74,10 @@ func (fs *FilerServer) uploadReaderToChunks(w http.ResponseWriter, r *http.Reque
|
|||||||
lock.Unlock()
|
lock.Unlock()
|
||||||
// handle read errors
|
// handle read errors
|
||||||
if readErr != nil {
|
if readErr != nil {
|
||||||
|
if err == nil {
|
||||||
|
err = readErr
|
||||||
|
}
|
||||||
if readErr != io.EOF {
|
if readErr != io.EOF {
|
||||||
if err == nil {
|
|
||||||
err = readErr
|
|
||||||
}
|
|
||||||
resultsChan <- &ChunkCreationResult{
|
resultsChan <- &ChunkCreationResult{
|
||||||
err: readErr,
|
err: readErr,
|
||||||
}
|
}
|
||||||
@@ -86,6 +86,9 @@ func (fs *FilerServer) uploadReaderToChunks(w http.ResponseWriter, r *http.Reque
|
|||||||
}
|
}
|
||||||
if len(data) == 0 {
|
if len(data) == 0 {
|
||||||
readErr = io.EOF
|
readErr = io.EOF
|
||||||
|
if err == nil {
|
||||||
|
err = readErr
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -120,6 +123,10 @@ func (fs *FilerServer) uploadReaderToChunks(w http.ResponseWriter, r *http.Reque
|
|||||||
|
|
||||||
waitForAllData.Wait()
|
waitForAllData.Wait()
|
||||||
|
|
||||||
|
if err == io.EOF {
|
||||||
|
err = nil
|
||||||
|
}
|
||||||
|
|
||||||
return fileChunks, md5Hash, readOffset, err, nil
|
return fileChunks, md5Hash, readOffset, err, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user