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-mplex
Commits
fd72cdc0
Unverified
Commit
fd72cdc0
authored
May 23, 2019
by
Steven Allen
Committed by
GitHub
May 23, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #61 from libp2p/fix/disable-write-coalescing
disable write coalescing
parents
8df7f3d7
e636aee8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
multiplex.go
multiplex.go
+8
-2
No files found.
multiplex.go
View file @
fd72cdc0
...
@@ -192,7 +192,11 @@ func (mp *Multiplex) handleOutgoing() {
...
@@ -192,7 +192,11 @@ func (mp *Multiplex) handleOutgoing() {
return
return
case
data
:=
<-
mp
.
writeCh
:
case
data
:=
<-
mp
.
writeCh
:
err
:=
mp
.
writeMsg
(
data
)
// FIXME: https://github.com/libp2p/go-libp2p/issues/644
// write coalescing disabled until this can be fixed.
//err := mp.writeMsg(data)
err
:=
mp
.
doWriteMsg
(
data
)
pool
.
Put
(
data
)
if
err
!=
nil
{
if
err
!=
nil
{
// the connection is closed by this time
// the connection is closed by this time
log
.
Warningf
(
"error writing data: %s"
,
err
.
Error
())
log
.
Warningf
(
"error writing data: %s"
,
err
.
Error
())
...
@@ -204,7 +208,9 @@ func (mp *Multiplex) handleOutgoing() {
...
@@ -204,7 +208,9 @@ func (mp *Multiplex) handleOutgoing() {
func
(
mp
*
Multiplex
)
writeMsg
(
data
[]
byte
)
error
{
func
(
mp
*
Multiplex
)
writeMsg
(
data
[]
byte
)
error
{
if
len
(
data
)
>=
512
{
if
len
(
data
)
>=
512
{
return
mp
.
doWriteMsg
(
data
)
err
:=
mp
.
doWriteMsg
(
data
)
pool
.
Put
(
data
)
return
err
}
}
buf
:=
pool
.
Get
(
4096
)
buf
:=
pool
.
Get
(
4096
)
...
...
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