Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
c43f539f
Commit
c43f539f
authored
Feb 01, 2015
by
Juan Batiz-Benet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmds/cat: fix length to use reader.Size()
unixfs file size != merkledag cumulative size
parent
fcd8ebcc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
6 deletions
+1
-6
core/commands/cat.go
core/commands/cat.go
+1
-6
No files found.
core/commands/cat.go
View file @
c43f539f
...
...
@@ -68,17 +68,12 @@ func cat(node *core.IpfsNode, paths []string) ([]io.Reader, uint64, error) {
return
nil
,
0
,
err
}
nodeLength
,
err
:=
dagnode
.
Size
()
if
err
!=
nil
{
return
nil
,
0
,
err
}
length
+=
nodeLength
read
,
err
:=
uio
.
NewDagReader
(
node
.
Context
(),
dagnode
,
node
.
DAG
)
if
err
!=
nil
{
return
nil
,
0
,
err
}
readers
=
append
(
readers
,
read
)
length
+=
uint64
(
read
.
Size
())
}
return
readers
,
length
,
nil
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment