packages/libs/libevhtp/patches/021-openssl-thread.patch
Rosen Penev 9c77d6721f libevhtp: Update to 1.2.0
In the tree, libevhtp is used only for Seafile. This is the most recent
version that Haiwen lists as working.

Updated threads patch for OpenSSL 1.1.

Removed Maintainer as he is inactive.

Simplified Makefile a little bit and reorganized for consistency between
packages.

Fixed compilation with uClibc-ng.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2019-05-07 16:33:09 -07:00

45 lines
1.4 KiB
Diff

--- a/evhtp.c
+++ b/evhtp.c
@@ -1797,10 +1797,10 @@ _evhtp_accept_cb(evserv_t * serv, int fd, struct sockaddr * s, int sl, void * ar
}
#ifndef EVHTP_DISABLE_SSL
-#ifndef EVHTP_DISABLE_EVTHR
-static unsigned long
-_evhtp_ssl_get_thread_id(void) {
- return (unsigned long)pthread_self();
+#if !defined(EVHTP_DISABLE_EVTHR) && (OPENSSL_VERSION_NUMBER < 0x10100000L)
+static void
+_evhtp_ssl_get_thread_id(CRYPTO_THREADID *id) {
+ CRYPTO_THREADID_set_numeric(id, (unsigned long)pthread_self());
}
static void
@@ -3050,7 +3050,9 @@ evhtp_use_threads(evhtp_t * htp, evhtp_thread_init_cb init_cb, int nthreads, voi
htp->thread_init_cbarg = arg;
#ifndef EVHTP_DISABLE_SSL
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
evhtp_ssl_use_threads();
+#endif
#endif
if (!(htp->thr_pool = evthr_pool_new(nthreads, _evhtp_thread_init, htp))) {
@@ -3161,7 +3163,7 @@ evhtp_set_post_accept_cb(evhtp_t * htp, evhtp_post_accept_cb cb, void * arg) {
}
#ifndef EVHTP_DISABLE_SSL
-#ifndef EVHTP_DISABLE_EVTHR
+#if !defined(EVHTP_DISABLE_EVTHR) && (OPENSSL_VERSION_NUMBER < 0x10100000L)
int
evhtp_ssl_use_threads(void) {
int i;
@@ -3179,7 +3181,7 @@ evhtp_ssl_use_threads(void) {
pthread_mutex_init(&(ssl_locks[i]), NULL);
}
- CRYPTO_set_id_callback(_evhtp_ssl_get_thread_id);
+ CRYPTO_THREADID_set_callback(_evhtp_ssl_get_thread_id);
CRYPTO_set_locking_callback(_evhtp_ssl_thread_lock);
return 0;