-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: read goroutine nil pointer panic #235
Conversation
errors/errors.go
Outdated
@@ -41,6 +41,8 @@ var ( | |||
ErrUnsupportedUDSProtocol = errors.New("only unix is supported") | |||
// ErrUnsupportedPlatform occurs when running gnet on an unsupported platform. | |||
ErrUnsupportedPlatform = errors.New("unsupported platform in gnet") | |||
// ErrConnectionClosed occurs when connection is closed but eventloop.ch still receive this connection. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
改成 "ErrConnectionClosed occurs when the event-loop receives a closed connection."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Codecov Report
@@ Coverage Diff @@
## master #235 +/- ##
==========================================
- Coverage 82.50% 82.35% -0.15%
==========================================
Files 18 18
Lines 1743 1746 +3
==========================================
Hits 1438 1438
- Misses 253 255 +2
- Partials 52 53 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
1. Are you opening this pull request for bug-fixs, optimizations or new feature?
bug-fixs
2. Please describe how these code changes achieve your intention.
windows下的 listenerRun 也就是 read 操作是一个 goroutine,而另外的 react & write 在另一个 goroutine,并且 write 出错时可能会修改 conn,这个操作必须让 read goroutine 知道,否则会导致 panic,所以做了此修改,
3. Please link to the relevant issues (if any).
4. Which documentation changes (if any) need to be made/updated because of this PR?
4. Checklist