mirror of
https://github.com/lammertb/libhttp.git
synced 2025-12-22 04:02:04 +03:00
Add check for size of thread ID (required for SSL)
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user