Merge branch 'master' of github.com:ppiaas/lotus-ppiaas into fix/stg-fetch-close
This commit is contained in:
commit
c7de7882a1
5
extern/sector-storage/stores/http_handler.go
vendored
5
extern/sector-storage/stores/http_handler.go
vendored
@ -116,9 +116,12 @@ func (handler *FetchHandler) remoteGetSector(w http.ResponseWriter, r *http.Requ
|
||||
w.WriteHeader(500)
|
||||
return
|
||||
}
|
||||
if !stat.IsDir() {
|
||||
defer rd.(*os.File).Close()
|
||||
}
|
||||
|
||||
w.WriteHeader(200)
|
||||
if _, err := io.Copy(w, rd); err != nil { // TODO: default 32k buf may be too small
|
||||
if _, err := io.CopyBuffer(w, rd, make([]byte, CopyBuf)); err != nil {
|
||||
log.Errorf("%+v", err)
|
||||
return
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user