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

Don't crash if a socket is closed server side #205

Merged
merged 1 commit into from
Sep 26, 2018

Conversation

choptastic
Copy link
Contributor

If, for some reason, the programmer decides to close the socket server side,
the return value for setopts on the socket is {error, einval} rather than
{error, closed}. This change accepts that and suppresses the error message
generated by a badmatch at https://github.com/mochi/mochiweb/blob/master/src/mochiweb_http.erl#L88

If for some reason, the programmer decides to close the socket server side,
the return value for setopts on the socket is {error, einval} rather than
{error, closed}. This change accepts that and suppresses the error message
generated.
@choptastic choptastic changed the title Don't crash of a socket is closed server side Don't crash if a socket is closed server side Sep 26, 2018
Copy link
Member

@etrepum etrepum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@etrepum etrepum merged commit 9608d78 into mochi:master Sep 26, 2018
@choptastic
Copy link
Contributor Author

Thanks Bob! That's some speedy stuff :)

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