Skip to content

Commit e4a5613

Browse files
committed
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. git-svn-id: https://svn.apache.org/repos/asf/serf/trunk@1931210 13f79535-47bb-0310-9956-ffa450edef68
1 parent 65ea3e0 commit e4a5613

6 files changed

Lines changed: 15 additions & 26 deletions

File tree

README

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ kept to a minimum to provide high performance operation.
1010
* Official Git Mirror: https://github.com/apache/serf/
1111
* Issues: https://issues.apache.org/jira/browse/SERF
1212
* Mail: dev@serf.apache.org
13-
* People: Justin Erenkrantz, Greg Stein
1413

1514
----
1615

@@ -21,6 +20,13 @@ kept to a minimum to provide high performance operation.
2120
Apache Serf can use either SCons or CMake. Both build systems should offer
2221
the same features.
2322

23+
A note on the required dependencies:
24+
- APR and APR-Util must be at least version 1.3.0.
25+
- Use a modern OpenSSL 3.x. Serf will work with OpenSSL 1.1.1 and maybe
26+
even 0.9.x, but those versions have known security bugs. LibreSSL seems
27+
to work, but we don't test it.
28+
- Use the latest ZLib to avoid buffer overrun bugs.
29+
2430
1.1.1 SCons build system
2531

2632
You must use at least SCons version 2.3.5. If it is not installed
@@ -251,4 +257,3 @@ $ cmake -DENABLE_SLOW_TESTS=ON
251257

252258
$ cmake --build out --target install
253259
$ cmake --build out --config Release --target install
254-

serf.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@
3535
#include <apr_time.h>
3636
#include <apr_poll.h>
3737
#include <apr_uri.h>
38+
#include <apr_version.h>
39+
#if !APR_VERSION_AT_LEAST(1, 3, 0)
40+
#error "The APR version must be 1.3.0 or newer"
41+
#endif
3842

3943
#ifdef __cplusplus
4044
extern "C" {

serf_private.h

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,6 @@ typedef int serf__bool_t; /* Not _Bool */
8080
#define REQUESTED_MAX (~((apr_size_t)0))
8181
#endif
8282

83-
#ifndef APR_VERSION_AT_LEAST /* Introduced in APR 1.3.0 */
84-
#define APR_VERSION_AT_LEAST(major,minor,patch) \
85-
(((major) < APR_MAJOR_VERSION) \
86-
|| ((major) == APR_MAJOR_VERSION && (minor) < APR_MINOR_VERSION) \
87-
|| ((major) == APR_MAJOR_VERSION && (minor) == APR_MINOR_VERSION && \
88-
(patch) <= APR_PATCH_VERSION))
89-
#endif /* APR_VERSION_AT_LEAST */
90-
9183
#define SERF_IO_CLIENT (1)
9284
#define SERF_IO_CONN (2)
9385
#define SERF_IO_LISTENER (3)
@@ -215,14 +207,11 @@ apr_status_t serf__incoming_ssl_error(const void *baton,
215207
#define ACTIVE_LOGLEVEL SERF_LOG_NONE
216208
#define ACTIVE_LOGCOMPS SERF_LOGCOMP_NONE
217209

218-
/* Older versions of APR do not have the APR_VERSION_AT_LEAST macro. Those
219-
implementations are safe.
220-
221-
If the macro *is* defined, and we're on WIN32, and APR is version 1.4.0+,
222-
then we have a broken WSAPoll() implementation.
210+
/* If we're on WIN32, and APR is version 1.4.0+, then we have
211+
a broken WSAPoll() implementation.
223212
224213
See serf_context_create_ex() below. */
225-
#if defined(APR_VERSION_AT_LEAST) && defined(WIN32)
214+
#ifdef WIN32
226215
#if APR_VERSION_AT_LEAST(1,4,0)
227216
#define BROKEN_WSAPOLL
228217
#endif

src/init_once.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,9 @@
1919
*/
2020

2121
#include <apr.h>
22-
#include <apr_version.h>
2322
#if APR_HAS_THREADS
2423
# include <apr_atomic.h>
2524
# include <apr_time.h>
26-
/* FIXME: Do we really want to support APR-0.9.x? */
27-
# if APR_MAJOR_VERSION < 1
28-
# define apr_atomic_cas32(m, v, c) apr_atomic_cas((m), (v), (c))
29-
# endif
3025
#endif
3126

3227
#include "serf_private.h"

test/MockHTTPinC/MockHTTP_server.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
#include "MockHTTP_private.h"
4848

4949
/* Copied from serf. */
50-
#if defined(APR_VERSION_AT_LEAST) && defined(WIN32)
50+
#ifdef WIN32
5151
#if APR_VERSION_AT_LEAST(1,4,0)
5252
#define BROKEN_WSAPOLL
5353
#endif

test/serf_get.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -898,11 +898,7 @@ int main(int argc, const char **argv)
898898
handler_ctx.completed_requests = 0;
899899
handler_ctx.print_headers = print_headers;
900900

901-
#if APR_VERSION_AT_LEAST(1, 3, 0)
902901
apr_file_open_flags_stdout(&handler_ctx.output_file, APR_BUFFERED, pool);
903-
#else
904-
apr_file_open_stdout(&handler_ctx.output_file, pool);
905-
#endif
906902

907903
handler_ctx.host = url.hostinfo;
908904
handler_ctx.method = method;

0 commit comments

Comments
 (0)