Skip to content

Added a utility to set the ssl library's MT hooks. #527

Merged
merged 1 commit into from Nov 15, 2011

5 participants

@jimfcarroll
Team Kodi member

This should fix the MT problems with libraries that use SSL. Namely, libcurl. It sets openssl and/or gcrypt locking hooks. It expects gcrypt to be used only on LINUX like machines.

Currently the Windows implementation is missing (at least) the openssl header file(s).

@WiSo, can you let me know what I need to do to get openssl/crypto.h installed on windows? We apparently already have the dll.

@jimfcarroll
Team Kodi member

WiSo, sorry about the miss-ping (if you check).

@wsoltys is who I meant. ^^

@wsoltys
Team Kodi member
wsoltys commented Nov 6, 2011

hehe, WiSo = wsoltys so you pinged me twice ;)
We're using a precompiled libcurl from here http://www.gknw.de/mirror/curl/win32/old_releases/. Problem is every third party lib can ship it's own version of ssl. If we just have an eye on curl we can take the dev package of the version used by libcurl and put it in our dependency lib. We just have to take this version in future too if we need ssl somewhere else and want to use our dependency system (or bump it if we bump libcurl).
Let me see if I can cook something together today or tomorrow.

@wsoltys
Team Kodi member
wsoltys commented Nov 6, 2011

I've added the missing headers but getting unresolved external symbols for _CRYPTO_set_locking_callback and _CRYPTO_set_id_callback. To resolve them I would need the ssl import lib which fits to the ssl dll used by the third party build of libcurl which we don't have.
Do we have the curl locking in windows as well or can we skip this implementation?

@wsoltys
Team Kodi member
wsoltys commented Nov 7, 2011

so we don't need any changes on win32. If worth I can change to a newer version of libcurl which uses openssl 1.0.0

@jimfcarroll
Team Kodi member

If that's the case I'm going to simply add a destructor to clean up the locks then check this in. Is everyone Ok with that?

@ghost
ghost commented Nov 7, 2011

what a bloody mess. pull is fine with me.

@elupus
Team Kodi member
elupus commented Nov 7, 2011

We should do as done in that ffmpeg commit, only set the thread id for older versions.

@arnova
Team Kodi member
arnova commented Nov 9, 2011

I'm fine with this. Are you sure this works properly with libcurl-gnutls? I'm not that familar with the internals of this...

@jimfcarroll
Team Kodi member

@arnova, I copied the code from an example and on my system HAVE_GCRYPT is true and it executes. I'm not sure how else to verify it since it's used indirectly anyway.

@davilla
davilla commented Nov 15, 2011

status on this pull/req ? I've been seeing reports of hangs and bt logs that point to

libcrypto.0.9.8.dylib 0x0276a6b8 lh_insert + 152

@jimfcarroll
Team Kodi member

I have a code change that includes a simplification and cleanup (previous to this the locks don't get cleaned up) I didn't get a chance to check in this weekend. I'll do it shortly.

@jimfcarroll
Team Kodi member

Ok, one more review would help.

@jimfcarroll
Team Kodi member

Ok, I'm putting this in. Please let me know if it addresses the problems we've been seeing.

@jimfcarroll jimfcarroll merged commit f587ca9 into xbmc:master Nov 15, 2011
@tru tru added a commit to plexinc/plex-home-theater-public that referenced this pull request Jun 21, 2013
@tru tru Fix playing from remote
Fixes #527, Fixes #521
c46f820
@notspiff notspiff pushed a commit to notspiff/kodi-cmake that referenced this pull request Nov 3, 2013
@davilla davilla [osx] fixed, add missing bit from xbmc/xbmc#527 e698e3e
@notspiff notspiff pushed a commit to notspiff/kodi-cmake that referenced this pull request Nov 3, 2013
@davilla davilla [ios] fixed, add missing bit from xbmc/xbmc#527 eb9e268
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.