Author: brane
Date: Fri Jan 23 06:38:32 2026
New Revision: 1931478

Log:
Build and tests should work when APR doesn't support threads.

* auth/auth.c
  (cleanup_user_scheme): Don't call init_authn_schemes_guard() explicitly.

* test/MockHTTPinC/MockHTTP_server.c
  (run_thread): Define function only if APR supports threads.
  (mhStartServer, mhStopServer): Move threading-specific local variables
   inside the APR_HAS_THREADS conditional block.

Modified:
   serf/trunk/auth/auth.c
   serf/trunk/test/MockHTTPinC/MockHTTP_server.c

Modified: serf/trunk/auth/auth.c
==============================================================================
--- serf/trunk/auth/auth.c      Fri Jan 23 05:49:15 2026        (r1931477)
+++ serf/trunk/auth/auth.c      Fri Jan 23 06:38:32 2026        (r1931478)
@@ -621,9 +621,7 @@ static apr_status_t cleanup_user_scheme(
     const serf__authn_scheme_t *slot = NULL;
     int index;
 
-    apr_status_t lock_status = init_authn_schemes_guard(NULL);
-    if (!lock_status)
-        lock_status = lock_authn_schemes(NULL);
+    apr_status_t lock_status = lock_authn_schemes(NULL);
     if (lock_status)
         return lock_status;
 

Modified: serf/trunk/test/MockHTTPinC/MockHTTP_server.c
==============================================================================
--- serf/trunk/test/MockHTTPinC/MockHTTP_server.c       Fri Jan 23 05:49:15 
2026        (r1931477)
+++ serf/trunk/test/MockHTTPinC/MockHTTP_server.c       Fri Jan 23 06:38:32 
2026        (r1931478)
@@ -133,6 +133,7 @@ struct _mhClientCtx_t {
 /**
  * Start up a server in a separate thread.
  */
+#if APR_HAS_THREADS
 static void * APR_THREAD_FUNC run_thread(apr_thread_t *tid, void *baton)
 {
     mhServCtx_t *ctx = baton;
@@ -144,6 +145,7 @@ static void * APR_THREAD_FUNC run_thread
     apr_thread_exit(tid, APR_SUCCESS);
     return NULL;
 }
+#endif
 
 /**
  * Callback called when the mhServCtx_t pool is destroyed.
@@ -1776,12 +1778,13 @@ void mhConfigServer(mhServCtx_t *serv_ct
  */
 void mhStartServer(mhServCtx_t *ctx)
 {
-    apr_thread_t *thread;
     mhError_t err = MOCKHTTP_NO_ERROR;
     apr_status_t status;
 
     if (ctx->threading == mhThreadSeparate) {
 #if APR_HAS_THREADS
+        apr_thread_t *thread;
+
         /* Setup a non-blocking TCP server */
         status = setupTCPServer(ctx);
         if (!status) {
@@ -1806,8 +1809,8 @@ void mhStartServer(mhServCtx_t *ctx)
 
 void mhStopServer(mhServCtx_t *ctx)
 {
+#if APR_HAS_THREADS
     apr_status_t status;
-#ifdef APR_HAS_THREADS
     if (ctx->threading == mhThreadSeparate && ctx->threadid) {
         ctx->cancelThread = YES;
         apr_thread_join(&status, ctx->threadid);

Reply via email to