// TODO(cryptix): find these helpers somewhere else func (i *gatewayHandler) newDagFromReader(r io.Reader) (*dag.Node, error) { // TODO(cryptix): change and remove this helper once PR1136 is merged // return ufs.AddFromReader(i.node, r.Body) return importer.BuildDagFromReader( i.node.DAG, chunk.DefaultSplitter(r), importer.BasicPinnerCB(i.node.Pinning.GetManual())) }
func add(n *core.IpfsNode, reader io.Reader) (*merkledag.Node, error) { mp := n.Pinning.GetManual() return importer.BuildDagFromReader( n.DAG, chunk.DefaultSplitter(reader), importer.PinIndirectCB(mp), ) }