Skip to content
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

Description: #31

Merged
merged 1 commit into from
Nov 2, 2022
Merged

Description: #31

merged 1 commit into from
Nov 2, 2022

Conversation

gokpm
Copy link
Contributor

@gokpm gokpm commented Oct 30, 2022

  1. The exported receivers on the websocket.(*Conn) will not panic
  2. The websocket.(*Conn) becomes nil, in some instances, leading to unpredictable panics in the receivers i.e websocket.(*Conn).SetWriteDeadline(), websocket.(*Conn).beginMessage()
  3. The websocket.(*Conn).(net.Conn) becomes nil, in some instances, leading to unpredicatble panics in i.e websocket.(*Conn).(net.Conn).SetWriteDeadline()
  4. The panics are handled by nil pointer check in case of websocket.(*Conn) & nil interface check in case of websocket.(*Conn).(net.Conn) before accessing the fields.
  5. The panics are handled in the exported receivers at the moment and based on the need, we can handle the panics similarly in the unexported receivers as well.
  6. 2 new errors (websocket.ErrNilConn & websocket.ErrNilNetConn) are defined in errors.go and returned for all the modified receivers, in which an error could be returned.
  7. Additional return of an error in all the exported receivers would break existing applications.
  8. Prevent the applciation crash from this package, return errors and let the application disconnect the websocket connection gracefully.

1. The exported receivers on the websocket.(*Conn) will not panic
2. The websocket.(*Conn) becomes nil, in some instances, leading to unpredictable panics in the receivers i.e websocket.(*Conn).SetWriteDeadline(), websocket.(*Conn).beginMessage()
3. The websocket.(*Conn).(net.Conn) becomes nil, in some instances, leading to unpredicatble panics in i.e websocket.(*Conn).(net.Conn).SetWriteDeadline()
4. The panics are handled by nil pointer check in case of websocket.(*Conn) & nil interface check in case of websocket.(*Conn).(net.Conn) before accessing the fields.
5. The panics are handled in the exported receivers at the moment and based on the need, we can handle the panics similarly in the unexported receivers as well.
6. 2 new errors (websocket.ErrNilConn & websocket.ErrNilNetConn) are defined in errors.go and returned for all the modified receivers, in which an error could be returned.
7. Additional return of an error in all the exported receivers would break existing applications.
8. Prevent the applciation crash from this package, return errors and let the application disconnect the websocket connection gracefully.
@savsgio savsgio merged commit b8ea6bd into fasthttp:master Nov 2, 2022
@savsgio
Copy link
Member

savsgio commented Nov 2, 2022

Thank you so much!

@gokpm
Copy link
Contributor Author

gokpm commented Nov 2, 2022

Thank you so much!

Most welcome! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants