1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-07-02 03:28:25 +08:00

adder: fix bug where errors from calls to NewAdder caused daemon to hang

License: MIT
Signed-off-by: Kevin Atkinson <k@kevina.org>
This commit is contained in:
Kevin Atkinson
2017-03-03 17:18:57 -05:00
parent e17a6dd803
commit b7eae36f90

View File

@ -202,15 +202,15 @@ You can now refer to the added file in a gateway, like so:
bserv := blockservice.New(addblockstore, exch)
dserv := dag.NewDAGService(bserv)
outChan := make(chan interface{}, 8)
res.SetOutput((<-chan interface{})(outChan))
fileAdder, err := coreunix.NewAdder(req.Context(), n.Pinning, n.Blockstore, dserv)
if err != nil {
res.SetError(err, cmds.ErrNormal)
return
}
outChan := make(chan interface{}, 8)
res.SetOutput((<-chan interface{})(outChan))
fileAdder.Out = outChan
fileAdder.Chunker = chunker
fileAdder.Progress = progress