D-Programming-Language/phobos — pull request #2086 by tcsc (2014-04-18 14:49:45+00:00)
Title: fixes Issue 9054 - std.net.curl byLineAsync and byChunkAsync broken.

It turns out that a couple of the curl options reset in Curl.dup() are only valid if libcurl has been built against newer and/or specific versions of OpenSSL.

If you have a libcurl that uses an incompatible version of OpenSSL (like Ubuntu 12.04 as described in the bug report), or use an alternative SSL implementation (like OSX, which is how *I* tripped over the issue myself), then Curl.dup() would raise an exception.

I have added a variant of ```Curl.clear()``` called ```Curl.clearIfSupported()``` that will attempt to reset the appropriate curl option and ignore the "invalid parameter" error code. All other errors will be checked as per ```Curl.clear()```.

Tested on both OSX Mavericks and Ubuntu 12.04 64-bit.