Skip to content

Incorrect idle connection count in HTTP manager #185

@nikomi

Description

@nikomi

Hi,

I believe the idle connection count is incremented incorrectly in module Network.HTTP.Client.Manager function putSocket line 156.

The code currently is

                let (l', mx) = addToList now (mMaxConns man) ci l
                    cnt' = idleCount + maybe 0 (const 1) mx
                    m' = ManagerOpen cnt' (Map.insert key l' m)

Since addToList returns Nothing if the connection was added to the idle pool and Just ci if the connection was not added (and has to be closed) the constants 0 and 1 should probably be reversed and the line should read:

                    cnt' = idleCount + maybe 1 (const 0) mx

What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions