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

HTTPRequestHandler incorrectly manages the channel lifecycle. #241

Open
Davidde94 opened this issue Sep 15, 2020 · 1 comment
Open

HTTPRequestHandler incorrectly manages the channel lifecycle. #241

Davidde94 opened this issue Sep 15, 2020 · 1 comment

Comments

@Davidde94
Copy link

Davidde94 commented Sep 15, 2020

In summary, the connection limiting issues are caused by these lines of code inside HTTPRequestHandler:

func channelInactive(context: ChannelHandlerContext, httpServer: HTTPServer) {
        httpServer.connectionCount.sub(1)
}

This method doesn't belong to ChannelInboundHandler, and so NIO doesn't call it automatically. The fix is very simple, to remove the httpServer argument and use the locally-stored server reference.

The connection limiting as a whole is a little questionable, but I'll address that in a separate issue.

@Davidde94
Copy link
Author

Ah, my colleague just found that someone has already addressed this in a commit:
6fe04a0

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

No branches or pull requests

1 participant