Skip to content

HTTPRequestHandler incorrectly manages the channel lifecycle. #241

@Davidde94

Description

@Davidde94

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions