From b567e04495d9fbc0c70b324a16a95c557a7875ed Mon Sep 17 00:00:00 2001 From: bel Date: Wed, 9 Sep 2015 21:29:43 +0200 Subject: [PATCH] Add check for size of thread ID (required for SSL) --- src/civetweb.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/civetweb.c b/src/civetweb.c index 69e60391..14fa1ccc 100755 --- a/src/civetweb.c +++ b/src/civetweb.c @@ -9554,6 +9554,12 @@ ssl_locking_callback(int mode, int mutex_num, const char *file, int line) static unsigned long ssl_id_callback(void) { + /* CRYPTO_set_id_callback() assumes thread IDs can be represented by + * unsigned long. See + * https://www.openssl.org/docs/manmaster/crypto/threads.html#HISTORY */ + mg_static_assert(sizeof(pthread_t) <= sizeof(unsigned long), + "Thread-ID data type size check"); + return (unsigned long)pthread_self(); }