Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Netpoll
Commits
1344445e
Commit
1344445e
authored
3 years ago
by
Hchen
Browse files
Options
Download
Email Patches
Plain Diff
fix: Write panic when conn Close (#96)
parent
985eb363
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
connection_impl.go
+7
-1
connection_impl.go
with
7 additions
and
1 deletion
+7
-1
connection_impl.go
+
7
-
1
View file @
1344445e
...
...
@@ -242,9 +242,15 @@ func (c *connection) Read(p []byte) (n int, err error) {
// Write will Flush soon.
func
(
c
*
connection
)
Write
(
p
[]
byte
)
(
n
int
,
err
error
)
{
if
!
c
.
lock
(
flushing
)
{
return
0
,
Exception
(
ErrConnClosed
,
"when write"
)
}
defer
c
.
unlock
(
flushing
)
dst
,
_
:=
c
.
outputBuffer
.
Malloc
(
len
(
p
))
n
=
copy
(
dst
,
p
)
err
=
c
.
Flush
()
c
.
outputBuffer
.
Flush
()
err
=
c
.
flush
()
return
n
,
err
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
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
Menu
Projects
Groups
Snippets
Help