-
Notifications
You must be signed in to change notification settings - Fork 18
Description
Hi,
It turns out that the curl bindings are not doing the right thing w.r.t. threaded use of the library. I reported this on haskell cafe a bit earlier, and in the meantime I have found out some more details on this.
The (C) curl library is special: while it uses one of OpenSSL, GCrypt or NSS (not sure about the last one), it doesn't set up the actual SSL library for threaded usage. Which means that for single-threaded uses, it's perfectly safe, however when switching to a threaded model, random segfaults/aborts start to crop up.
Looking at other bindings for curl, e.g. the Python pycurl bindings, it looks like explicit SSL handling is needed in case of threading.
So an option would be to do that in curl (haskell) bindings itself; the alternative, doing it in a separate mini-library that is explicitly linked in by the user would be tricky, as only curl headers define exactly what SSL backend it uses.