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
fd2b8faf
Commit
fd2b8faf
authored
Nov 21, 2014
by
Jeromy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some cleanup, and fix minor bug in dagreader from previous commit
parent
f62fd5b2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
6 deletions
+13
-6
io/dagreader.go
io/dagreader.go
+13
-6
No files found.
io/dagreader.go
View file @
fd2b8faf
...
...
@@ -61,12 +61,8 @@ func NewDagReader(n *mdag.Node, serv mdag.DAGService) (io.Reader, error) {
func
(
dr
*
DagReader
)
precalcNextBuf
()
error
{
var
nxt
*
mdag
.
Node
var
ok
bool
select
{
case
nxt
,
ok
=
<-
dr
.
fetchChan
:
if
!
ok
{
return
io
.
EOF
}
default
:
if
dr
.
serv
==
nil
{
// Only used when fetchChan is nil,
// which only happens when passed in a nil dagservice
// TODO: this logic is hard to follow, do it better.
...
...
@@ -76,7 +72,18 @@ func (dr *DagReader) precalcNextBuf() error {
return
io
.
EOF
}
nxt
=
dr
.
node
.
Links
[
dr
.
linkPosition
]
.
Node
if
nxt
==
nil
{
return
errors
.
New
(
"Got nil node back from link! and no DAGService!"
)
}
dr
.
linkPosition
++
}
else
{
select
{
case
nxt
,
ok
=
<-
dr
.
fetchChan
:
if
!
ok
{
return
io
.
EOF
}
}
}
pb
:=
new
(
ftpb
.
Data
)
...
...
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