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-unixfs
Commits
ce223eef
Commit
ce223eef
authored
Oct 30, 2014
by
Jeromy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some small cleanup of logging
parent
3ed10b13
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
6 deletions
+11
-6
core/commands/add.go
core/commands/add.go
+3
-3
unixfs/io/dagreader.go
unixfs/io/dagreader.go
+8
-3
No files found.
core/commands/add.go
View file @
ce223eef
...
...
@@ -82,7 +82,7 @@ func addDir(n *core.IpfsNode, fpath string, depth int, out io.Writer) (*dag.Node
}
}
log
.
Info
(
"adding dir: %s"
,
fpath
)
log
.
Info
f
(
"adding dir: %s"
,
fpath
)
return
tree
,
addNode
(
n
,
tree
,
fpath
,
out
)
}
...
...
@@ -98,10 +98,10 @@ func addFile(n *core.IpfsNode, fpath string, depth int, out io.Writer) (*dag.Nod
return
nil
,
err
}
log
.
Info
(
"adding file: %s"
,
fpath
)
log
.
Info
f
(
"adding file: %s"
,
fpath
)
for
_
,
l
:=
range
root
.
Links
{
log
.
Info
(
"adding subblock: %s %s"
,
l
.
Name
,
l
.
Hash
.
B58String
())
log
.
Info
f
(
"adding subblock:
'
%s
'
%s"
,
l
.
Name
,
l
.
Hash
.
B58String
())
}
k
,
err
:=
root
.
Key
()
...
...
unixfs/io/dagreader.go
View file @
ce223eef
...
...
@@ -18,7 +18,7 @@ type DagReader struct {
serv
mdag
.
DAGService
node
*
mdag
.
Node
position
int
buf
*
bytes
.
Buff
er
buf
io
.
Read
er
}
// NewDagReader creates a new reader object that reads the data represented by the given
...
...
@@ -71,8 +71,13 @@ func (dr *DagReader) precalcNextBuf() error {
return
ft
.
ErrInvalidDirLocation
case
ftpb
.
Data_File
:
//TODO: this *should* work, needs testing first
//return NewDagReader(nxt, dr.serv)
panic
(
"Not yet handling different layers of indirection!"
)
log
.
Warning
(
"Running untested code for multilayered indirect FS reads."
)
subr
,
err
:=
NewDagReader
(
nxt
,
dr
.
serv
)
if
err
!=
nil
{
return
err
}
dr
.
buf
=
subr
return
nil
case
ftpb
.
Data_Raw
:
dr
.
buf
=
bytes
.
NewBuffer
(
pb
.
GetData
())
return
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