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
04f92118
Commit
04f92118
authored
Jan 24, 2015
by
Matt Bell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
unixfs/tar: Fixed reader not properly buffering headers
parent
d38b695e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
tar/reader.go
tar/reader.go
+8
-7
No files found.
tar/reader.go
View file @
04f92118
...
...
@@ -79,6 +79,7 @@ func (i *Reader) writeToBuf(dagnode *mdag.Node, path string, depth int) {
i
.
emitError
(
err
)
return
}
i
.
flush
()
for
_
,
link
:=
range
dagnode
.
Links
{
childNode
,
err
:=
link
.
GetNode
(
i
.
dag
)
...
...
@@ -102,6 +103,7 @@ func (i *Reader) writeToBuf(dagnode *mdag.Node, path string, depth int) {
i
.
emitError
(
err
)
return
}
i
.
flush
()
reader
,
err
:=
uio
.
NewDagReader
(
dagnode
,
i
.
dag
)
if
err
!=
nil
{
...
...
@@ -150,6 +152,11 @@ func (i *Reader) signal() {
i
.
signalChan
<-
struct
{}{}
}
func
(
i
*
Reader
)
flush
()
{
i
.
signal
()
<-
i
.
signalChan
}
func
(
i
*
Reader
)
emitError
(
err
error
)
{
i
.
err
=
err
i
.
signal
()
...
...
@@ -157,10 +164,6 @@ func (i *Reader) emitError(err error) {
func
(
i
*
Reader
)
close
()
{
i
.
closed
=
true
i
.
flush
()
}
func
(
i
*
Reader
)
flush
()
{
defer
i
.
signal
()
err
:=
i
.
writer
.
Close
()
if
err
!=
nil
{
...
...
@@ -185,9 +188,7 @@ func (i *Reader) syncCopy(reader io.Reader) error {
if
err
!=
nil
{
return
err
}
i
.
signal
()
// wait for Read to finish reading
<-
i
.
signalChan
i
.
flush
()
}
if
err
==
io
.
EOF
{
break
...
...
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