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
p2p
go-yamux
Commits
083dccd3
Commit
083dccd3
authored
Feb 16, 2021
by
Marten Seemann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
don't reimplement io.ReadFull
parent
b6118a4b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
13 deletions
+2
-13
util.go
util.go
+2
-13
No files found.
util.go
View file @
083dccd3
...
...
@@ -151,21 +151,10 @@ func (s *segmentedBuffer) Read(b []byte) (int, error) {
func
(
s
*
segmentedBuffer
)
Append
(
input
io
.
Reader
,
length
int
)
error
{
dst
:=
pool
.
Get
(
length
)
n
:=
0
read
:=
0
var
err
error
for
n
<
length
&&
err
==
nil
{
read
,
err
=
input
.
Read
(
dst
[
n
:
])
n
+=
read
}
n
,
err
:=
io
.
ReadFull
(
input
,
dst
)
if
err
==
io
.
EOF
{
if
length
==
n
{
err
=
nil
}
else
{
err
=
io
.
ErrUnexpectedEOF
}
err
=
io
.
ErrUnexpectedEOF
}
s
.
bm
.
Lock
()
defer
s
.
bm
.
Unlock
()
if
n
>
0
{
...
...
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