You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.4 KiB

  1. --- a/evhtp.c
  2. +++ b/evhtp.c
  3. @@ -1797,10 +1797,10 @@ _evhtp_accept_cb(evserv_t * serv, int fd, struct sockaddr * s, int sl, void * ar
  4. }
  5. #ifndef EVHTP_DISABLE_SSL
  6. -#ifndef EVHTP_DISABLE_EVTHR
  7. -static unsigned long
  8. -_evhtp_ssl_get_thread_id(void) {
  9. - return (unsigned long)pthread_self();
  10. +#if !defined(EVHTP_DISABLE_EVTHR) && (OPENSSL_VERSION_NUMBER < 0x10100000L)
  11. +static void
  12. +_evhtp_ssl_get_thread_id(CRYPTO_THREADID *id) {
  13. + CRYPTO_THREADID_set_numeric(id, (unsigned long)pthread_self());
  14. }
  15. static void
  16. @@ -3050,7 +3050,9 @@ evhtp_use_threads(evhtp_t * htp, evhtp_thread_init_cb init_cb, int nthreads, voi
  17. htp->thread_init_cbarg = arg;
  18. #ifndef EVHTP_DISABLE_SSL
  19. +#if OPENSSL_VERSION_NUMBER < 0x10100000L
  20. evhtp_ssl_use_threads();
  21. +#endif
  22. #endif
  23. if (!(htp->thr_pool = evthr_pool_new(nthreads, _evhtp_thread_init, htp))) {
  24. @@ -3161,7 +3163,7 @@ evhtp_set_post_accept_cb(evhtp_t * htp, evhtp_post_accept_cb cb, void * arg) {
  25. }
  26. #ifndef EVHTP_DISABLE_SSL
  27. -#ifndef EVHTP_DISABLE_EVTHR
  28. +#if !defined(EVHTP_DISABLE_EVTHR) && (OPENSSL_VERSION_NUMBER < 0x10100000L)
  29. int
  30. evhtp_ssl_use_threads(void) {
  31. int i;
  32. @@ -3179,7 +3181,7 @@ evhtp_ssl_use_threads(void) {
  33. pthread_mutex_init(&(ssl_locks[i]), NULL);
  34. }
  35. - CRYPTO_set_id_callback(_evhtp_ssl_get_thread_id);
  36. + CRYPTO_THREADID_set_callback(_evhtp_ssl_get_thread_id);
  37. CRYPTO_set_locking_callback(_evhtp_ssl_thread_lock);
  38. return 0;