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
0938471d
Commit
0938471d
authored
Dec 24, 2014
by
Juan Batiz-Benet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ctxio: fix buffer of 1 so goroutine exits when io completes.
parent
989d3d4c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
util/ctx/ctxio.go
util/ctx/ctxio.go
+2
-2
No files found.
util/ctx/ctxio.go
View file @
0938471d
...
...
@@ -45,7 +45,7 @@ func (w *ctxWriter) Write(buf []byte) (int, error) {
buf2
:=
make
([]
byte
,
len
(
buf
))
copy
(
buf2
,
buf
)
c
:=
make
(
chan
ioret
)
c
:=
make
(
chan
ioret
,
1
)
go
func
()
{
n
,
err
:=
w
.
w
.
Write
(
buf2
)
...
...
@@ -92,7 +92,7 @@ func NewReader(ctx context.Context, r io.Reader) *ctxReader {
func
(
r
*
ctxReader
)
Read
(
buf
[]
byte
)
(
int
,
error
)
{
buf2
:=
make
([]
byte
,
len
(
buf
))
c
:=
make
(
chan
ioret
)
c
:=
make
(
chan
ioret
,
1
)
go
func
()
{
n
,
err
:=
r
.
r
.
Read
(
buf2
)
...
...
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