Skip to content
This repository has been archived by the owner on Jun 30, 2021. It is now read-only.

Commit

Permalink
Reorganize OpenSSL < 1.0.0 compatibility for greater readability.
Browse files Browse the repository at this point in the history
  • Loading branch information
neheb committed Jan 23, 2019
1 parent 78e8e41 commit 955b878
Showing 1 changed file with 13 additions and 21 deletions.
34 changes: 13 additions & 21 deletions evhtp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2828,36 +2828,28 @@ htp__accept_cb_(struct evconnlistener * serv, int fd, struct sockaddr * s, int s
#ifndef EVHTP_DISABLE_SSL
#ifndef EVHTP_DISABLE_EVTHR
#if OPENSSL_VERSION_NUMBER < 0x10100000L
static
#if OPENSSL_VERSION_NUMBER >= 0x10000000L
void
#else
unsigned long
#endif
htp__ssl_get_thread_id_(
#if OPENSSL_VERSION_NUMBER >= 0x10000000L
CRYPTO_THREADID * id
#else
void
#endif
)
{
unsigned long tid;

#ifndef WIN32
tid = (unsigned long)pthread_self();
unsigned long tid = (unsigned long)pthread_self();
#else
tid = pthread_self().p;
unsigned long tid = pthread_self().p;
#endif

#if OPENSSL_VERSION_NUMBER >= 0x10000000L
CRYPTO_THREADID_set_numeric(id, tid);
#if OPENSSL_VERSION_NUMBER < 0x10000000L
static unsigned long
htp__ssl_get_thread_id_(void)
{
return tid;
}
#else
return tid;
static void
htp__ssl_get_thread_id_(CRYPTO_THREADID *id)
{
CRYPTO_THREADID_set_numeric(id, tid);
}
#endif

#endif
}

static void
htp__ssl_thread_lock_(int mode, int type, const char * file, int line)
Expand Down

0 comments on commit 955b878

Please sign in to comment.