Commit f59ac367 authored by Aaron Bannert's avatar Aaron Bannert
Browse files

Gets us compiling again on FreeBSD. Adds conditional compilation around

thread mutex routines for when we don't have APR_HAS_THREADS.

Submitted by:	Justin Erenkrantz
Reviewed by:	Aaron Bannert


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk/modules/ssl@92061 13f79535-47bb-0310-9956-ffa450edef68
parent 63f7c8b6
Loading
Loading
Loading
Loading
+2 −0
Changes for ssl_engine_init.c: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -185,7 +185,9 @@ void ssl_init_Module(apr_pool_t *p, apr_pool_t *plog,
        ssl_init_SSLLibrary();
    }
#endif
#if APR_HAS_THREADS
    ssl_util_thread_setup(s, p);
#endif
    if (mc->nInitCount == 1) {
        ssl_pphrase_Handle(s, p);
        ssl_init_TmpKeysHandle(SSL_TKP_GEN, s, p);
+2 −4
Changes for ssl_util.c: 2 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -334,6 +334,7 @@ SSLModConfigRec *ssl_util_getmodconfig_ssl(SSL *ssl, const char *key)
    return mc;
}

#if APR_HAS_THREADS
/*
 * To ensure thread-safetyness in OpenSSL - work in progress
 */
@@ -352,12 +353,10 @@ static void ssl_util_thr_lock(int mode, int type, const char *file, int line)
    }
}

#if APR_HAS_THREADS
static unsigned long ssl_util_thr_id(void)
{
    return (unsigned long) apr_os_thread_current();
}
#endif

static apr_status_t ssl_util_thread_cleanup(void *data)
{
@@ -399,9 +398,7 @@ void ssl_util_thread_setup(server_rec *s, apr_pool_t *p)
        apr_thread_mutex_create(&(lock_cs[i]), APR_THREAD_MUTEX_DEFAULT, p);
    }

#if APR_HAS_THREADS
    CRYPTO_set_id_callback(ssl_util_thr_id);
#endif

    CRYPTO_set_locking_callback(ssl_util_thr_lock);

@@ -410,3 +407,4 @@ void ssl_util_thread_setup(server_rec *s, apr_pool_t *p)
                              apr_pool_cleanup_null);

}
#endif