Author: brane
Date: Sat Jan 10 05:40:34 2026
New Revision: 1931210

Log:
Remove support for APR older than 1.3.0.

* README: Add a note about dependency versions.
   Also: remove the "People" heading, as it's obsolete.
* serf.h: Check APR version at compile time.
* serf_private.h
  (APR_VERSION_AT_LEAST): Remove our version of this macro, user APR's.
  (BROKEN_WSAPOLL): Update comment and conditions.
* src/init_once.c: Don't jump through hoops for APR-0.9.x.
* test/MockHTTPinC/MockHTTP_server.c
  (BROKEN_WSAPOLL): Do as serf_private.h does.
* test/serf_get.c
  (main): Remove conditional code for older APR versions.

Modified:
   serf/trunk/README
   serf/trunk/serf.h
   serf/trunk/serf_private.h
   serf/trunk/src/init_once.c
   serf/trunk/test/MockHTTPinC/MockHTTP_server.c
   serf/trunk/test/serf_get.c

Modified: serf/trunk/README
==============================================================================
--- serf/trunk/README   Sat Jan 10 04:20:02 2026        (r1931209)
+++ serf/trunk/README   Sat Jan 10 05:40:34 2026        (r1931210)
@@ -10,7 +10,6 @@ kept to a minimum to provide high perfor
   * Official Git Mirror: https://github.com/apache/serf/
   * Issues: https://issues.apache.org/jira/browse/SERF
   * Mail: [email protected]
-  * People: Justin Erenkrantz, Greg Stein
 
 ----
 
@@ -21,6 +20,13 @@ kept to a minimum to provide high perfor
 Apache Serf can use either SCons or CMake. Both build systems should offer
 the same features.
 
+A note on the required dependencies:
+  - APR and APR-Util must be at least version 1.3.0.
+  - Use a modern OpenSSL 3.x. Serf will work with OpenSSL 1.1.1 and maybe
+    even 0.9.x, but those versions have known security bugs. LibreSSL seems
+    to work, but we don't test it.
+  - Use the latest ZLib to avoid buffer overrun bugs.
+
 1.1.1 SCons build system
 
 You must use at least SCons version 2.3.5. If it is not installed
@@ -251,4 +257,3 @@ $ cmake -DENABLE_SLOW_TESTS=ON
 
     $ cmake --build out --target install
     $ cmake --build out --config Release --target install
-

Modified: serf/trunk/serf.h
==============================================================================
--- serf/trunk/serf.h   Sat Jan 10 04:20:02 2026        (r1931209)
+++ serf/trunk/serf.h   Sat Jan 10 05:40:34 2026        (r1931210)
@@ -35,6 +35,10 @@
 #include <apr_time.h>
 #include <apr_poll.h>
 #include <apr_uri.h>
+#include <apr_version.h>
+#if !APR_VERSION_AT_LEAST(1, 3, 0)
+#error "The APR version must be 1.3.0 or newer"
+#endif
 
 #ifdef __cplusplus
 extern "C" {

Modified: serf/trunk/serf_private.h
==============================================================================
--- serf/trunk/serf_private.h   Sat Jan 10 04:20:02 2026        (r1931209)
+++ serf/trunk/serf_private.h   Sat Jan 10 05:40:34 2026        (r1931210)
@@ -80,14 +80,6 @@ typedef int serf__bool_t; /* Not _Bool *
 #define REQUESTED_MAX (~((apr_size_t)0))
 #endif
 
-#ifndef APR_VERSION_AT_LEAST /* Introduced in APR 1.3.0 */
-#define APR_VERSION_AT_LEAST(major,minor,patch)                           \
-    (((major) < APR_MAJOR_VERSION)                                        \
-      || ((major) == APR_MAJOR_VERSION && (minor) < APR_MINOR_VERSION)    \
-      || ((major) == APR_MAJOR_VERSION && (minor) == APR_MINOR_VERSION && \
-               (patch) <= APR_PATCH_VERSION))
-#endif /* APR_VERSION_AT_LEAST */
-
 #define SERF_IO_CLIENT (1)
 #define SERF_IO_CONN (2)
 #define SERF_IO_LISTENER (3)
@@ -215,14 +207,11 @@ apr_status_t serf__incoming_ssl_error(co
 #define ACTIVE_LOGLEVEL SERF_LOG_NONE
 #define ACTIVE_LOGCOMPS SERF_LOGCOMP_NONE
 
-/* Older versions of APR do not have the APR_VERSION_AT_LEAST macro. Those
-   implementations are safe.
-
-   If the macro *is* defined, and we're on WIN32, and APR is version 1.4.0+,
-   then we have a broken WSAPoll() implementation.
+/* If we're on WIN32, and APR is version 1.4.0+, then we have
+   a broken WSAPoll() implementation.
 
    See serf_context_create_ex() below.  */
-#if defined(APR_VERSION_AT_LEAST) && defined(WIN32)
+#ifdef WIN32
 #if APR_VERSION_AT_LEAST(1,4,0)
 #define BROKEN_WSAPOLL
 #endif

Modified: serf/trunk/src/init_once.c
==============================================================================
--- serf/trunk/src/init_once.c  Sat Jan 10 04:20:02 2026        (r1931209)
+++ serf/trunk/src/init_once.c  Sat Jan 10 05:40:34 2026        (r1931210)
@@ -19,14 +19,9 @@
  */
 
 #include <apr.h>
-#include <apr_version.h>
 #if APR_HAS_THREADS
 #  include <apr_atomic.h>
 #  include <apr_time.h>
-/* FIXME: Do we really want to support APR-0.9.x? */
-#  if APR_MAJOR_VERSION < 1
-#    define apr_atomic_cas32(m, v, c) apr_atomic_cas((m), (v), (c))
-#  endif
 #endif
 
 #include "serf_private.h"

Modified: serf/trunk/test/MockHTTPinC/MockHTTP_server.c
==============================================================================
--- serf/trunk/test/MockHTTPinC/MockHTTP_server.c       Sat Jan 10 04:20:02 
2026        (r1931209)
+++ serf/trunk/test/MockHTTPinC/MockHTTP_server.c       Sat Jan 10 05:40:34 
2026        (r1931210)
@@ -47,7 +47,7 @@
 #include "MockHTTP_private.h"
 
 /* Copied from serf.  */
-#if defined(APR_VERSION_AT_LEAST) && defined(WIN32)
+#ifdef WIN32
 #if APR_VERSION_AT_LEAST(1,4,0)
 #define BROKEN_WSAPOLL
 #endif

Modified: serf/trunk/test/serf_get.c
==============================================================================
--- serf/trunk/test/serf_get.c  Sat Jan 10 04:20:02 2026        (r1931209)
+++ serf/trunk/test/serf_get.c  Sat Jan 10 05:40:34 2026        (r1931210)
@@ -898,11 +898,7 @@ int main(int argc, const char **argv)
     handler_ctx.completed_requests = 0;
     handler_ctx.print_headers = print_headers;
 
-#if APR_VERSION_AT_LEAST(1, 3, 0)
     apr_file_open_flags_stdout(&handler_ctx.output_file, APR_BUFFERED, pool);
-#else
-    apr_file_open_stdout(&handler_ctx.output_file, pool);
-#endif
 
     handler_ctx.host = url.hostinfo;
     handler_ctx.method = method;

Reply via email to