Merge pull request #1212 from filecoin-project/fix/remote-put-commit

remote: Fix put in commit
This commit is contained in:
Łukasz Magiera 2020-02-04 18:22:12 +01:00 committed by GitHub
commit 6eb342b8ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 5 deletions

View File

@ -455,7 +455,7 @@ var chainBisectCmd = &cli.Command{
for {
mid := (start + end) / 2
if end - start == 1 {
if end-start == 1 {
mid = end
start = end
}

View File

@ -108,11 +108,21 @@ func (sm *StorageMinerAPI) remotePutSector(w http.ResponseWriter, r *http.Reques
}
// This is going to get better with worker-to-worker transfers
path, err := sm.SectorBuilder.AllocSectorPath(fs.DataType(vars["type"]), id, true)
path, err := sm.SectorBuilder.SectorPath(fs.DataType(vars["type"]), id)
if err != nil {
log.Error(err)
w.WriteHeader(500)
return
if err != fs.ErrNotFound {
log.Error(err)
w.WriteHeader(500)
return
}
path, err = sm.SectorBuilder.AllocSectorPath(fs.DataType(vars["type"]), id, true)
if err != nil {
log.Error(err)
w.WriteHeader(500)
return
}
}
mediatype, _, err := mime.ParseMediaType(r.Header.Get("Content-Type"))