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

Fix not closing sockets in http server #10

Merged
merged 5 commits into from
May 30, 2022
Merged

Conversation

sashkent3
Copy link
Contributor

There is a bug in http server ss.receive function overload. It doesn't return "closed" as err when client disconnects. Thus client sockets do not close and after some number of requests every call to ss.update crashes with bad argument #1 to 'select' (descriptor too large for set size).

@sashkent3
Copy link
Contributor Author

Also added some minor changes to the code which allow to use Defold's own socket library.

Copy link
Owner

@britzl britzl left a comment

Choose a reason for hiding this comment

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

Thank you for the contribution. I do have some questions and concerns that we need to discuss before this can be merged.

defnet/tcp_server.lua Outdated Show resolved Hide resolved
defnet/http_server.lua Outdated Show resolved Hide resolved
@sashkent3 sashkent3 requested a review from britzl May 30, 2022 09:37
Copy link
Owner

@britzl britzl left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks!

@britzl britzl merged commit bc30b1c into britzl:master May 30, 2022
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