Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Nov 15, 2011

Conversation

jimfcarroll
Copy link
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
Copy link
Member Author

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

@wsoltys is who I meant. ^^

@wsoltys
Copy link

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
Copy link

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?

@elupus
Copy link
Contributor

elupus commented Nov 7, 2011

@wsoltys
Copy link

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
Copy link
Member Author

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
Copy link

ghost commented Nov 7, 2011

what a bloody mess. pull is fine with me.

@elupus
Copy link
Contributor

elupus commented Nov 7, 2011

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

@arnova
Copy link
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
Copy link
Member Author

@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
Copy link
Contributor

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
Copy link
Member Author

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
Copy link
Member Author

Ok, one more review would help.

@jimfcarroll
Copy link
Member Author

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

jimfcarroll pushed a commit that referenced this pull request Nov 15, 2011
Added a utility to set the ssl library's MT hooks.
@jimfcarroll jimfcarroll merged commit f587ca9 into xbmc:master Nov 15, 2011
margro referenced this pull request in margro/xbmc May 20, 2012
pvr: fix issues #521 and #524
tru pushed a commit to plexinc/plex-home-theater-public that referenced this pull request Jun 21, 2013
notspiff pushed a commit to notspiff/kodi-cmake that referenced this pull request Nov 3, 2013
notspiff pushed a commit to notspiff/kodi-cmake that referenced this pull request Nov 3, 2013
HolgerW1 pushed a commit to HolgerW1/xbmc that referenced this pull request Sep 26, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants