Browse Source

avoid overwriting non-nil uploadReaderToChunks.uploadErr with nil value (#4560)

pull/4562/head
柏杰 2 years ago
committed by GitHub
parent
commit
68feffa4e6
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      weed/server/filer_server_handlers_write_upload.go

4
weed/server/filer_server_handlers_write_upload.go

@ -70,9 +70,13 @@ func (fs *FilerServer) uploadReaderToChunks(w http.ResponseWriter, r *http.Reque
if err != nil || dataSize == 0 {
bufPool.Put(bytesBuffer)
<-bytesBufferLimitChan
if err != nil {
uploadErrLock.Lock()
if uploadErr == nil {
uploadErr = err
}
uploadErrLock.Unlock()
}
break
}
if chunkOffset == 0 && !isAppend {

Loading…
Cancel
Save