good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
websocket
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
github
nhooyr
websocket
Commits
26dd4ac8
Unverified
Commit
26dd4ac8
authored
Aug 21, 2019
by
Anmol Sethi
Browse files
Options
Downloads
Patches
Plain Diff
Consider StatusGoingAway a io.EOF in NetConn
parent
20ccbc4c
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
netconn.go
+3
-2
3 additions, 2 deletions
netconn.go
with
3 additions
and
2 deletions
netconn.go
+
3
−
2
View file @
26dd4ac8
...
@@ -33,7 +33,8 @@ import (
...
@@ -33,7 +33,8 @@ import (
// The Addr methods will return a mock net.Addr that returns "websocket" for Network
// The Addr methods will return a mock net.Addr that returns "websocket" for Network
// and "websocket/unknown-addr" for String.
// and "websocket/unknown-addr" for String.
//
//
// A received StatusNormalClosure close frame will be translated to EOF when reading.
// A received StatusNormalClosure or StatusGoingAway close frame will be translated to
// io.EOF when reading.
func
NetConn
(
c
*
Conn
,
msgType
MessageType
)
net
.
Conn
{
func
NetConn
(
c
*
Conn
,
msgType
MessageType
)
net
.
Conn
{
nc
:=
&
netConn
{
nc
:=
&
netConn
{
c
:
c
,
c
:
c
,
...
@@ -93,7 +94,7 @@ func (c *netConn) Read(p []byte) (int, error) {
...
@@ -93,7 +94,7 @@ func (c *netConn) Read(p []byte) (int, error) {
typ
,
r
,
err
:=
c
.
c
.
Reader
(
c
.
readContext
)
typ
,
r
,
err
:=
c
.
c
.
Reader
(
c
.
readContext
)
if
err
!=
nil
{
if
err
!=
nil
{
var
ce
CloseError
var
ce
CloseError
if
xerrors
.
As
(
err
,
&
ce
)
&&
(
ce
.
Code
==
StatusNormalClosure
)
{
if
xerrors
.
As
(
err
,
&
ce
)
&&
(
ce
.
Code
==
StatusNormalClosure
)
||
(
ce
.
Code
==
StatusGoingAway
)
{
c
.
eofed
=
true
c
.
eofed
=
true
return
0
,
io
.
EOF
return
0
,
io
.
EOF
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment