benoitc/hackney — pull request #51 by benmmurphy (2013-12-02 16:51:03+00:00)
Title: allow user to differentiate connect/recv timeout

when we get an {error, timeout} during gen_tcp:connect return {error, connect_timeout} instead of {error, timeout}

previously you would get {error, timeout} both when a gen_tcp:connect timed out and when a receive timeout was reached.

this kind of breaks the API a bit but I think it is an improvement. you may want to look at further changes that make it easier for clients to separate errors where the request definitely did not reach the server from errors where the request may have reached the server. having an {error, {connection_failed, Reason}} might be better. i think ibrowse does something like this.