Skip to content

withResponseHistory: recv: invalid argument (Bad file descriptor) #169

@dzhus

Description

@dzhus

I'm experiencing the following issue with http-client-0.4.24, on Mac OS X 10.10.5 and Ubuntu 14.04.

import Prelude
import Network.HTTP.Client

followUrl' :: Manager
           -> String
           -> IO String
followUrl' mgr url = do
    req <- parseUrl url
    withResponseHistory req mgr $ \hr ->
        return $ show $ getUri $ hrFinalRequest hr

This fails with Bad file descriptor error for URLs which produce 404s:

λ> newManager defaultManagerSettings >>= (\m -> parseUrl "http://www.nytimes.com/2015/12/11/" >>= \r -> httpLbs r m)
*** Exception: StatusCodeException (Status {statusCode = 404, statusMessage = "Not Found"}) [("Server","Apache"),("X-App-Name","error"),...
λ> newManager defaultManagerSettings >>= (`followUrl'` "http://www.nytimes.com/2015/12/11/")
*** Exception: recv: invalid argument (Bad file descriptor)

Any ideas?

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