yeah, that's a consideration. I've cleaned up the code to remove all back-compat stuff for versions prior to 2.0.46. I'll let it run through my nightly builds and see how it went tomorrow.

everything looks ok, with the exception of t/filter/TestFilter/in_str_consume.pm, which hangs even though the comments say it should only hang for 2.0.40 and older.


so, attached is a patch that tested fine for me on 2.0.46 and 2.0.47 under perl-5.8.0, and I'm running it against 2.0 cvs, 2.1 cvs, and perl variants now.

please give it a whirl and let me know how it goes or if you think I missed something.

--Geoff
Index: Makefile.PL
===================================================================
RCS file: /home/cvspublic/modperl-2.0/Makefile.PL,v
retrieving revision 1.122
diff -u -r1.122 Makefile.PL
--- Makefile.PL 15 Aug 2003 23:56:16 -0000      1.122
+++ Makefile.PL 22 Aug 2003 14:59:25 -0000
@@ -6,7 +6,7 @@
 # directly or via the top level Makefile.PL
 $ENV{MOD_PERL_2_BUILD} = 1;
 
-my $min_httpd_version = '2.0.36';
+my $min_httpd_version = '2.0.46';
 
 my($old_modperl_version, $old_modperl_pm);
 
Index: README
===================================================================
RCS file: /home/cvspublic/modperl-2.0/README,v
retrieving revision 1.14
diff -u -r1.14 README
--- README      6 Aug 2003 22:38:53 -0000       1.14
+++ README      22 Aug 2003 14:59:25 -0000
@@ -3,7 +3,7 @@
 *** Prerequisites ***
 
 Apache:
-  This version of mod_perl works with Apache versions 2.0.36 -
+  This version of mod_perl works with Apache versions 2.0.46 -
   2.0.47. Newer Apache versions may work with this version of mod_perl.
   If not, the the cvs version likely will, which can be obtained from:
   
http://perl.apache.org/download/source.html#Development_mod_perl_2_0_Source_Distribution
Index: ModPerl-Registry/t/500.t
===================================================================
RCS file: /home/cvspublic/modperl-2.0/ModPerl-Registry/t/500.t,v
retrieving revision 1.7
diff -u -r1.7 500.t
--- ModPerl-Registry/t/500.t    24 Apr 2003 04:36:46 -0000      1.7
+++ ModPerl-Registry/t/500.t    22 Aug 2003 14:59:25 -0000
@@ -73,9 +73,7 @@
        );
 }
 
-# this behavior is specific for 2.0.42+ I think (at least it's still
-# different with apache < 2.0.41 (haven't tested with 41, 42, 43))
-if (HAVE_MIN_APACHE_2_0_42) {
+{
     # even though we have a runtime error here, the scripts succeeds
     # to send some body before the error happens and since by that
     # time Apache has already sent the headers, they will include 
Index: docs/devel/porting/porting.pod
===================================================================
RCS file: /home/cvspublic/modperl-docs/src/docs/2.0/devel/porting/porting.pod,v
retrieving revision 1.14
diff -u -r1.14 porting.pod
--- docs/devel/porting/porting.pod      11 Apr 2003 05:19:53 -0000      1.14
+++ docs/devel/porting/porting.pod      22 Aug 2003 14:59:25 -0000
@@ -29,14 +29,14 @@
 
   #include ap_mmn.h
   /* ... */
-  #if AP_MODULE_MAGIC_AT_LEAST(20020329,1)
+  #if AP_MODULE_MAGIC_AT_LEAST(20020903,3)
       /* 2.0 code */
   #else
       /* 1.0 code */
   #endif
 
 The C<20020329.1> is the value of the magic version number matching
-Apache 2.0.36, the earliest Apache version supported by mod_perl 2.0.
+Apache 2.0.46, the earliest Apache version supported by mod_perl 2.0.
 
 =head1 Thread Safety
 
Index: lib/Apache/Build.pm
===================================================================
RCS file: /home/cvspublic/modperl-2.0/lib/Apache/Build.pm,v
retrieving revision 1.141
diff -u -r1.141 Build.pm
--- lib/Apache/Build.pm 13 Aug 2003 23:13:11 -0000      1.141
+++ lib/Apache/Build.pm 22 Aug 2003 14:59:27 -0000
@@ -788,22 +788,8 @@
     my $apr_config_path = $self->apr_config_path;
 
     if ($apr_config_path) {
-        # --includedir is available since apr-0.9.3 (Apache 2.0.45),
-        # for older versions we attempt to parse 'apr-config --includes'
         my $httpd_version = $self->httpd_version;
-        if ($httpd_version lt '2.0.45') {
-            chomp(my $paths = `$apr_config_path --includes`);
-            for (split /\s+/, $paths || '') {
-                s/-I//;
-                if (-e catfile $_, "apr.h") {
-                    $incdir = $_;
-                    last;
-                }
-            }
-        }
-        else {
-            chomp($incdir = `$apr_config_path --includedir`);
-        }
+        chomp($incdir = `$apr_config_path --includedir`);
     }
 
     unless ($incdir and -d $incdir) {
Index: src/modules/perl/mod_perl.c
===================================================================
RCS file: /home/cvspublic/modperl-2.0/src/modules/perl/mod_perl.c,v
retrieving revision 1.179
diff -u -r1.179 mod_perl.c
--- src/modules/perl/mod_perl.c 20 Aug 2003 23:20:14 -0000      1.179
+++ src/modules/perl/mod_perl.c 22 Aug 2003 14:59:28 -0000
@@ -689,12 +689,7 @@
                               apr_pool_cleanup_null);
 }
 
-/* api change in 2.0.40-ish */
-#if (MODULE_MAGIC_NUMBER_MAJOR >= 20020628)
-#   define MP_FILTER_HANDLER(f) f, NULL
-#else
-#   define MP_FILTER_HANDLER(f) f
-#endif
+#define MP_FILTER_HANDLER(f) f, NULL
 
 void modperl_register_hooks(apr_pool_t *p)
 {
Index: src/modules/perl/modperl_apache_compat.c
===================================================================
RCS file: /home/cvspublic/modperl-2.0/src/modules/perl/modperl_apache_compat.c,v
retrieving revision 1.2
diff -u -r1.2 modperl_apache_compat.c
--- src/modules/perl/modperl_apache_compat.c    19 Aug 2003 19:30:33 -0000      1.2
+++ src/modules/perl/modperl_apache_compat.c    22 Aug 2003 14:59:28 -0000
@@ -1,25 +1,8 @@
 #include "mod_perl.h"
 
-/* back compat adjustements for older Apache versions */
-
-/* pre-APR_0_9_0 (APACHE_2_0_40) */
-#if APR_MAJOR_VERSION == 0 && APR_MINOR_VERSION == 9 && \
-    APR_PATCH_VERSION == 0 && defined(APR_IS_DEV_VERSION)
-
-/* added in APACHE_2_0_40/APR_0_9_0 */
-apr_status_t apr_socket_timeout_get(apr_socket_t *sock, apr_interval_time_t *t)
-{
-    modperl_apr_func_not_implemented(apr_sockettimeout_get, 2.0.40, 0.9.0);
-    return APR_ENOTIMPL;
-}
-
-apr_status_t apr_socket_timeout_set(apr_socket_t *sock, apr_interval_time_t t)
-{
-    modperl_apr_func_not_implemented(apr_socket_timeout_set, 2.0.40, 0.9.0);
-    return APR_ENOTIMPL;
-}
-
-#endif /* pre-APR_0_9_0 (APACHE_2_0_40) */
+/* back compat adjustements for older Apache versions
+ * BACK_COMPAT_MARKER: make back compat issues easy to find :)
+ */
 
 /* pre-APR_0_9_5 (APACHE_2_0_47)
  * both 2.0.46 and 2.0.47 shipped with 0.9.4 -
Index: src/modules/perl/modperl_apache_compat.h
===================================================================
RCS file: /home/cvspublic/modperl-2.0/src/modules/perl/modperl_apache_compat.h,v
retrieving revision 1.2
diff -u -r1.2 modperl_apache_compat.h
--- src/modules/perl/modperl_apache_compat.h    19 Aug 2003 19:30:33 -0000      1.2
+++ src/modules/perl/modperl_apache_compat.h    22 Aug 2003 14:59:28 -0000
@@ -9,31 +9,9 @@
 #endif
 
 /* XXX: these backcompat macros can be deleted when we bump up the
- * minimal supported httpd version to 2.0.40 or higher
+ * minimal supported httpd version to 2.0.47 or higher
+ * BACK_COMPAT_MARKER: make back compat issues easy to find :)
  */
-#ifndef apr_time_sec
-#define apr_time_sec(time) ((apr_int64_t)((time) / APR_USEC_PER_SEC))
-#endif
-#ifndef apr_time_usec
-#define apr_time_usec(time) ((apr_int32_t)((time) % APR_USEC_PER_SEC))
-#endif
-#ifndef apr_time_from_sec
-#define apr_time_from_sec(sec) ((apr_time_t)(sec) * APR_USEC_PER_SEC)
-#endif
-
-/* pre-APR_0_9_0 (APACHE_2_0_40) */
-#if APR_MAJOR_VERSION == 0 && APR_MINOR_VERSION == 9 && \
-    APR_PATCH_VERSION == 0 && defined(APR_IS_DEV_VERSION)
-
-/* deprecated since APR_0_9_0 */
-#define apr_socket_opt_get apr_getsocketopt
-#define apr_socket_opt_set apr_setsocketopt
-
-/* added in APACHE_2_0_40/APR_0_9_0 */
-apr_status_t apr_socket_timeout_get(apr_socket_t *sock, apr_interval_time_t *t);
-apr_status_t apr_socket_timeout_set(apr_socket_t *sock, apr_interval_time_t t);
-
-#endif /* pre-APR_0_9_0 (APACHE_2_0_40) */
 
 /* pre-APR_0_9_5 (APACHE_2_0_47)
  * both 2.0.46 and 2.0.47 shipped with 0.9.4 -
Index: src/modules/perl/modperl_apache_includes.h
===================================================================
RCS file: /home/cvspublic/modperl-2.0/src/modules/perl/modperl_apache_includes.h,v
retrieving revision 1.25
diff -u -r1.25 modperl_apache_includes.h
--- src/modules/perl/modperl_apache_includes.h  6 Aug 2003 06:46:35 -0000       1.25
+++ src/modules/perl/modperl_apache_includes.h  22 Aug 2003 14:59:28 -0000
@@ -20,24 +20,7 @@
 #include "ap_mpm.h"
 
 #include "apr_version.h"
-
-/* 2.0.36 is APR_0_9_0-dev */
-
-#if APR_MAJOR_VERSION == 0 && APR_MINOR_VERSION == 9 && APR_PATCH_VERSION < 3
-/* apr < 0.9.3 */
-#define APR_VERSION_0_9_3_MINUS
-#else
-/* apr >= 0.9.3 */
-#define APR_VERSION_0_9_3_PLUS
-#endif
-
-#ifndef APR_POLLIN
-/*
- * apr_poll.h introduced around 2.0.40
- * APR_POLL* constants moved here around 2.0.44
- */
 #include "apr_poll.h"
-#endif
 #include "apr_lib.h"
 #include "apr_strings.h"
 #include "apr_uri.h"
@@ -51,10 +34,5 @@
 #include "util_filter.h"
 
 #include "util_script.h"
-
-
-#ifdef APR_VERSION_0_9_3_PLUS
-#include "apr_env.h"
-#endif
 
 #endif /* MODPERL_APACHE_INCLUDES_H */
Index: t/apr-ext/perlio.t
===================================================================
RCS file: /home/cvspublic/modperl-2.0/t/apr-ext/perlio.t,v
retrieving revision 1.1
diff -u -r1.1 perlio.t
--- t/apr-ext/perlio.t  21 Aug 2003 02:11:30 -0000      1.1
+++ t/apr-ext/perlio.t  22 Aug 2003 14:59:28 -0000
@@ -30,7 +30,7 @@
 my $has_apr_config = $build->{apr_config_path} && 
     !$build->httpd_is_source_tree;
 
-my $tests = 11;
+my $tests = 12;
 my $lfs_tests = 3;
 
 $tests += $lfs_tests unless LARGE_FILES_CONFLICT;
@@ -142,10 +142,9 @@
     # slurp mode
     seek $fh, 0, Fcntl::SEEK_SET(); # rewind to the start
     local $/;
-    #XXX: does not work with current release of httpd (2.0.39)
-    #        ok t_cmp($expected_all,
-    #                 scalar(<$fh>),
-    #                 "slurp file");
+    ok t_cmp($expected_all,
+             scalar(<$fh>),
+             "slurp file");
 
     # test ungetc (a long sep requires read ahead)
     seek $fh, 0, Fcntl::SEEK_SET(); # rewind to the start
Index: t/filter/both_str_req_mix.t
===================================================================
RCS file: /home/cvspublic/modperl-2.0/t/filter/both_str_req_mix.t,v
retrieving revision 1.3
diff -u -r1.3 both_str_req_mix.t
--- t/filter/both_str_req_mix.t 20 Aug 2003 22:14:37 -0000      1.3
+++ t/filter/both_str_req_mix.t 22 Aug 2003 14:59:28 -0000
@@ -6,8 +6,7 @@
 use Apache::TestUtil;
 
 plan tests => 1, have 'deflate', 'include',
-    have_min_module_version("Compress::Zlib", "1.09"),
-    have_min_apache_version("2.0.43");
+    have_min_module_version("Compress::Zlib", "1.09");
 
 require Compress::Zlib;
 my $location = '/TestFilter__both_str_req_mix';
Index: t/filter/in_bbs_consume.t
===================================================================
RCS file: /home/cvspublic/modperl-2.0/t/filter/in_bbs_consume.t,v
retrieving revision 1.2
diff -u -r1.2 in_bbs_consume.t
--- t/filter/in_bbs_consume.t   6 Aug 2003 07:28:22 -0000       1.2
+++ t/filter/in_bbs_consume.t   22 Aug 2003 14:59:28 -0000
@@ -5,8 +5,7 @@
 use Apache::TestUtil;
 use Apache::TestRequest;
 
-plan tests => 1,
-    have { "hangs in 2.0.40 " => sub { !have_apache_version("2.0.40"); } };
+plan tests => 1;
 
 my $location = '/TestFilter__in_bbs_consume';
 
Index: t/filter/TestFilter/in_str_consume.pm
===================================================================
RCS file: /home/cvspublic/modperl-2.0/t/filter/TestFilter/in_str_consume.pm,v
retrieving revision 1.6
diff -u -r1.6 in_str_consume.pm
--- t/filter/TestFilter/in_str_consume.pm       7 Aug 2003 19:12:29 -0000       1.6
+++ t/filter/TestFilter/in_str_consume.pm       22 Aug 2003 14:59:29 -0000
@@ -53,10 +53,11 @@
         }
 
         # this is not needed in newer Apache versions, however older
-        # versions (2.0.40) will repeatedly call this filter, waiting
+        # versions (2.0.46) will repeatedly call this filter, waiting
         # for EOS which will never come from this filter so, after
         # several invocations mark the seen_eos flag, to break the
         # vicious cirle
+        # BACK_COMPAT_MARKER: make back compat issues easy to find
         if ($count > 10) {
             $filter->seen_eos(1);
         }
Index: t/response/TestAPI/rutil.pm
===================================================================
RCS file: /home/cvspublic/modperl-2.0/t/response/TestAPI/rutil.pm,v
retrieving revision 1.8
diff -u -r1.8 rutil.pm
--- t/response/TestAPI/rutil.pm 24 Apr 2003 04:27:22 -0000      1.8
+++ t/response/TestAPI/rutil.pm 22 Aug 2003 14:59:29 -0000
@@ -28,8 +28,6 @@
    500 => '500 Internal Server Error',
 );
 
-use constant HAVE_APACHE_2_0_40 => have_apache_version("2.0.40");
-
 sub handler {
     my $r = shift;
 
@@ -57,10 +55,8 @@
 
     ok $r->is_initial_req;
 
-    # XXX: Apache 2.0.40 seems to miss status and content-type
-    my $pattern = HAVE_APACHE_2_0_40
-        ? qr!(?s)GET /TestAPI__rutil.*Host:.*!
-        : qr!(?s)GET /TestAPI__rutil.*Host:.*200 OK.*Content-Type:!;
+    my $pattern = qr!(?s)GET /TestAPI__rutil.*Host:.*200 OK.*Content-Type:!;
+
     ok t_cmp(
         $pattern,
         $r->as_string,
Index: t/response/TestAPR/perlio.pm
===================================================================
RCS file: /home/cvspublic/modperl-2.0/t/response/TestAPR/perlio.pm,v
retrieving revision 1.21
diff -u -r1.21 perlio.pm
--- t/response/TestAPR/perlio.pm        20 Aug 2003 23:53:16 -0000      1.21
+++ t/response/TestAPR/perlio.pm        22 Aug 2003 14:59:29 -0000
@@ -18,7 +18,7 @@
 sub handler {
     my $r = shift;
 
-    my $tests = 11;
+    my $tests = 12;
     my $lfs_tests = 3;
 
     $tests += $lfs_tests unless LARGE_FILES_CONFLICT;
@@ -130,10 +130,10 @@
         # slurp mode
         seek $fh, 0, Fcntl::SEEK_SET(); # rewind to the start
         local $/;
-#XXX: does not work with current release of httpd (2.0.39)
-#        ok t_cmp($expected_all,
-#                 scalar(<$fh>),
-#                 "slurp file");
+
+        ok t_cmp($expected_all,
+                 scalar(<$fh>),
+                 "slurp file");
 
         # test ungetc (a long sep requires read ahead)
         seek $fh, 0, Fcntl::SEEK_SET(); # rewind to the start
Index: t/response/TestAPR/socket.pm
===================================================================
RCS file: /home/cvspublic/modperl-2.0/t/response/TestAPR/socket.pm,v
retrieving revision 1.2
diff -u -r1.2 socket.pm
--- t/response/TestAPR/socket.pm        24 Apr 2003 04:28:12 -0000      1.2
+++ t/response/TestAPR/socket.pm        22 Aug 2003 14:59:29 -0000
@@ -13,13 +13,10 @@
 use Apache::Const -compile => 'OK';
 use APR::Const -compile => 'EMISMATCH';
 
-use constant HAVE_APACHE_2_0_40 => have_min_apache_version("2.0.40");
-
 sub handler {
     my $r = shift;
 
-    my $tests = 1;
-    $tests += 3 if HAVE_APACHE_2_0_40;
+    my $tests = 4;
 
     plan $r, tests => $tests;
 
@@ -29,20 +26,18 @@
     ok $socket;
 
 
-    if (HAVE_APACHE_2_0_40) {
-        # in microseconds
-        my $orig_val = $socket->timeout_get();
-        t_debug "orig timeout was: $orig_val";
-        ok $orig_val;
-
-        my $new_val = 30_000_000; # 30 secs
-        $socket->timeout_set($new_val);
-        ok t_cmp($new_val, $socket->timeout_get(), "timeout_get()");
-
-        # reset the timeout
-        $socket->timeout_set($orig_val);
-        ok t_cmp($orig_val, $socket->timeout_get(), "timeout_get()");
-    }
+    # in microseconds
+    my $orig_val = $socket->timeout_get();
+    t_debug "orig timeout was: $orig_val";
+    ok $orig_val;
+
+    my $new_val = 30_000_000; # 30 secs
+    $socket->timeout_set($new_val);
+    ok t_cmp($new_val, $socket->timeout_get(), "timeout_get()");
+
+    # reset the timeout
+    $socket->timeout_set($orig_val);
+    ok t_cmp($orig_val, $socket->timeout_get(), "timeout_get()");
 
     Apache::OK;
 }
Index: t/response/TestAPR/table.pm
===================================================================
RCS file: /home/cvspublic/modperl-2.0/t/response/TestAPR/table.pm,v
retrieving revision 1.7
diff -u -r1.7 table.pm
--- t/response/TestAPR/table.pm 20 Aug 2003 13:59:45 -0000      1.7
+++ t/response/TestAPR/table.pm 22 Aug 2003 14:59:29 -0000
@@ -122,6 +122,7 @@
     ok @foo == 3;
     ok $bar[0] eq 'beer';
 
+    # BACK_COMPAT_MARKER: make back compat issues easy to find :)
     if (HAVE_APACHE_2_0_47) {
         $overlay->compress(APR::OVERLAP_TABLES_MERGE);
 
Index: xs/APR/APR/Makefile.PL
===================================================================
RCS file: /home/cvspublic/modperl-2.0/xs/APR/APR/Makefile.PL,v
retrieving revision 1.16
diff -u -r1.16 Makefile.PL
--- xs/APR/APR/Makefile.PL      12 Aug 2003 23:13:20 -0000      1.16
+++ xs/APR/APR/Makefile.PL      22 Aug 2003 14:59:29 -0000
@@ -13,9 +13,6 @@
         map { qq{$apr_bindir/$_-config} } qw(apr apu);
     chomp @libs;
     $libs = join ' ', @libs;
-
-    # fix for broken older apu-config script 0.9.2 (httpd 2.0.43)
-    $libs =~ s/-laprutil(?!-)/-laprutil-0/ if $libs =~ /-lapr-0/;
 }
 
 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to