Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 410453 | Differences between
and this patch

Collapse All | Expand All

(-)a/Changes (+63 lines)
Lines 10-15 Also refer to the Apache::Test changes log file, at Apache-Test/Changes Link Here
10
10
11
=over 3
11
=over 3
12
12
13
=item 2.0.6-dev
14
15
Adopt modperl_pcw.c changes from httpd24 branch. [Torsten Foertsch]
16
17
Pool cleanup functions must not longjmp. Catch these exceptions and turn
18
them into warnings. [Torsten Foertsch] 
19
20
Fix a race condition in our tipool management.
21
See http://www.gossamer-threads.com/lists/modperl/dev/104026
22
Patch submitted by: SalusaSecondus <salusa@nationstates.net>
23
Reviewed by: Torsten Foertsch
24
25
Ensure that MP_APXS is set when building on Win32 with MP_AP_PREFIX,
26
otherwise the bundled Reload and SizeLimit builds will fail to find a
27
properly configured Test environment.
28
[Steve Hay]
29
30
Fix a few REFCNT bugs.
31
Patch submitted by: Niko Tyni <ntyni@debian.org>
32
Reviewed by: Torsten Foertsch
33
34
Correct the initialization of the build config in ModPerl::MM. The global
35
variable was only being set once on loading the module, which was before
36
Apache2::BuildConfig.pm had been written, leading to cwd and MP_LIBNAME
37
being unset when writing the Reload and SizeLimit makefiles.
38
[Steve Hay]
39
40
Discover apr-2-config from Apache 2.4 onwards. [Gozer]
41
42
Apache 2.4 and onwards doesn't require linking the MPM module directly in
43
the httpd binary anymore. APXS lost the MPM_NAME query, so we can't assume
44
a given MPM anymore. Introduce a fake MPM 'dynamic' to represent this. 
45
[Torsten Foertsch, Gozer]
46
47
Perl 5.14 brought a few changes in Perl_sv_dup() that made a threaded apache
48
segfault while cloning interpreters.
49
[Torsten Foertsch]
50
51
PerlIOApache_flush() and mpxs_Apache2__RequestRec_rflush() now no longer throw
52
exceptions when modperl_wbucket_flush() fails if the failure was just a reset
53
connection or an aborted connection. The failure is simply logged to the error
54
log instead. This should fix cases of httpd.exe crashing when users press the
55
Stop button in their web browsers.
56
[Steve Hay]
57
58
Fixed a few issues that came up with LWP 6.00:
59
- t/response/TestAPI/request_rec.pm assumes HTTP/1.0 but LWP 6 uses 1.1
60
- t/api/err_headers_out.t fails due to a bug somewhere in LWP 6
61
- t/filter/TestFilter/out_str_reverse.pm sends the wrong content-length header
62
[Torsten Foertsch]
63
64
Bugfix: Apache2::ServerUtil::get_server{description,banner,version} cannot
65
be declared as perl constants or they won't reflect added version components
66
if Apache2::ServerUtil is loaded before the PostConfig phase. Now, they
67
are ordinary perl functions. [Torsten Foertsch]
68
69
Check for the right ExtUtils::Embed version during build [Torsten Foertsch]
70
71
Take a lesson from rt.cpan.org #66085 and pass LD_LIBRARY_PATH if mod_env
72
is present.  Should prevent test failures on some platforms.
73
[Fred Moyer]
74
75
13
=item 2.0.5 February 7, 2011
76
=item 2.0.5 February 7, 2011
14
77
15
The mod_perl PMC dedicates this release of mod_perl to Randy Kobes, who
78
The mod_perl PMC dedicates this release of mod_perl to Randy Kobes, who
(-)a/Makefile.PL (-6 / +17 lines)
Lines 52-57 my $code = ModPerl::Code->new; Link Here
52
52
53
sub UNATTENDED() { $build->{MP_PROMPT_DEFAULT} || ! -t STDIN }
53
sub UNATTENDED() { $build->{MP_PROMPT_DEFAULT} || ! -t STDIN }
54
54
55
# may populate $build->{MP_APXS}
55
win32_fetch_apxs() if WIN32;
56
win32_fetch_apxs() if WIN32;
56
57
57
configure();
58
configure();
Lines 241-246 EOI Link Here
241
        }
242
        }
242
    }
243
    }
243
244
245
    $build->{$_} and $ENV{$_} = $build->{$_} for (qw/MP_APXS MP_AP_PREFIX/);
246
244
    unless ($build->{MP_APXS} or $build->{MP_AP_PREFIX}) {
247
    unless ($build->{MP_APXS} or $build->{MP_AP_PREFIX}) {
245
        my $ok = 0;
248
        my $ok = 0;
246
        for my $path ($build->find) {
249
        for my $path ($build->find) {
Lines 621-626 sub win32_fetch_apxs { Link Here
621
    my $script = catfile($build->{cwd}, 'build', 'win32_fetch_apxs');
624
    my $script = catfile($build->{cwd}, 'build', 'win32_fetch_apxs');
622
    my @args = ($^X, $script, "--with-apache2=$prefix");
625
    my @args = ($^X, $script, "--with-apache2=$prefix");
623
    system(@args) == 0 or die "system @args failed: $?";
626
    system(@args) == 0 or die "system @args failed: $?";
627
    my $apxs = catfile($prefix, 'bin', 'apxs.bat');
628
    $build->{MP_APXS} = $apxs if -e $apxs;
624
}
629
}
625
630
626
631
Lines 777-783 PASSENV = $env Link Here
777
EOF
782
EOF
778
    }
783
    }
779
784
780
    return $preamble . <<'EOF';
785
    $preamble .= <<'EOF';
781
TEST_VERBOSE = 0
786
TEST_VERBOSE = 0
782
TEST_FILES =
787
TEST_FILES =
783
788
Lines 789-808 run_tests : test_clean Link Here
789
	$(PASSENV) \
794
	$(PASSENV) \
790
	$(FULLPERL) -I$(INST_ARCHLIB) -I$(INST_LIB) \
795
	$(FULLPERL) -I$(INST_ARCHLIB) -I$(INST_LIB) \
791
	t/TEST -bugreport -verbose=$(TEST_VERBOSE) $(TEST_FILES)
796
	t/TEST -bugreport -verbose=$(TEST_VERBOSE) $(TEST_FILES)
792
	$(MAKE) -k run_subtests
793
797
794
run_subtests ::
798
run_subtests ::
795
	$(MAKE) -C ModPerl-Registry test
799
	cd ModPerl-Registry && $(MAKE) test
796
800
797
run_subtests ::
801
run_subtests ::
798
	$(MAKE) -C Apache-Reload test
802
	cd Apache-Reload && $(MAKE) test
803
804
EOF
799
805
806
    $preamble .= <<'EOF' unless $build->mpm_is_threaded();
800
run_subtests ::
807
run_subtests ::
801
	$(MAKE) -C Apache-SizeLimit test
808
	cd Apache-SizeLimit && $(MAKE) test
809
810
EOF
802
811
803
test :: pure_all run_tests test_clean
812
    $preamble .= <<'EOF';
813
test :: pure_all run_tests run_subtests
804
EOF
814
EOF
805
815
816
    return $preamble;
806
}
817
}
807
818
808
sub MY::postamble {
819
sub MY::postamble {
(-)a/RELEASE (-35 / +39 lines)
Lines 55-61 Instructions for mod_perl 2.0 Release Manager Link Here
55
   to the modperl/dev list (may be longer to give most people a chance
55
   to the modperl/dev list (may be longer to give most people a chance
56
   to catch up). no need to tag this package
56
   to catch up). no need to tag this package
57
57
58
   Subject: [RELEASE CANDIDATE]: mod_perl-2.0.5 RC\d+
58
   Subject: [RELEASE CANDIDATE]: mod_perl-2.0.6 RC\d+
59
59
60
2a. if problems are detected during stage 2, repeat stages 1 and 2.
60
2a. if problems are detected during stage 2, repeat stages 1 and 2.
61
61
Lines 75-135 Instructions for mod_perl 2.0 Release Manager Link Here
75
     % make -n tag
75
     % make -n tag
76
76
77
  d. commit Changes README Makefile.PL
77
  d. commit Changes README Makefile.PL
78
     % svn ci -m "Releasing 2.0.5" Changes README Makefile.PL
78
     % svn ci -m "Releasing 2.0.6" Changes README Makefile.PL
79
79
80
  e. tag
80
  e. tag
81
     % make tag
81
     % make tag
82
82
83
  XXXX: See BRANCHING for the steps to include the proper tagged externals
83
  XXXX: This needs to be fixed, and updated, developer beware its outdated and possibly wrong
84
  XXXX: This needs to be fixed, and updated, developer beware its outdated and possibly wrong
84
  f. Update the svn:externals in the new tag
85
  f. Update the svn:externals in the new tag
85
     (you can't propedit remotely yet in svn)
86
     (you can't propedit remotely yet in svn)
86
     % svn co https://svn.apache.org/repos/asf/perl/modperl/tags/2_0_5
87
     % svn co https://svn.apache.org/repos/asf/perl/modperl/tags/2_0_6
87
     % svn propedit svn:externals 2_0_5
88
     % svn propedit svn:externals 2_0_6
88
     Update the Apache-Test line to current revision
89
     Update the Apache-Test line to current revision
89
     % svn info https://svn.apache.org/repos/asf/perl/Apache-Test/trunk | grep "Last Changed Rev"
90
     % svn info https://svn.apache.org/repos/asf/perl/Apache-Test/trunk | grep "Last Changed Rev"
90
     Update the docs line to the current tag.
91
     Update the docs line to the current tag.
91
     It should look like:
92
     It should look like:
92
     % svn propget svn:externals 2_0_5
93
     % svn propget svn:externals 2_0_6
93
       Apache-Test -r 608229 https://svn.apache.org/repos/asf/perl/Apache-Test/trunk
94
       Apache-Test -r 608229 https://svn.apache.org/repos/asf/perl/Apache-Test/trunk
94
       docs https://svn.apache.org/repos/asf/perl/modperl/docs/tags/2_0_5/src/docs/2.0
95
       docs https://svn.apache.org/repos/asf/perl/modperl/docs/tags/2_0_6/src/docs/2.0
95
96
96
     % svn ci -m "Releasing 2.0.5"
97
     % svn ci -m "Releasing 2.0.6"
97
98
98
  g. create the final package
99
  g. create the final package
99
     % make dist
100
     % make dist
100
101
101
  h. test the final package again at least once
102
  h. test the final package again at least once
102
103
103
4. Release the package and update links (e.g. mod_perl-2.0.5.tar.gz)
104
4. Release the package and update links (e.g. mod_perl-2.0.6.tar.gz)
104
105
105
  a. upload to people.apache.org:/www/perl.apache.org/dist/
106
  a. upload to people.apache.org:/www/perl.apache.org/dist/ - ask the PMC
107
     chair to give you the needed permissions if you do not have them.
106
108
107
    %  scp mod_perl-2.0.5.tar.gz people.apache.org:/www/perl.apache.org/dist/
109
    %  scp mod_perl-2.0.6.tar.gz people.apache.org:/www/perl.apache.org/dist/
108
110
109
  b. ssh to people.apache.org, unpack the package, update symlinks to the
111
  b. ssh to people.apache.org, unpack the package, update symlinks to the
110
     tar ball and unpacked distro:
112
     tar ball and unpacked distro:
111
113
112
    % ssh people.apache.org
114
    % ssh people.apache.org
113
    % cd /www/perl.apache.org/dist/
115
    % cd /www/perl.apache.org/dist/
114
    % ln -sf mod_perl-2.0.5.tar.gz mod_perl-2.0-current.tar.gz
116
    % ln -sf mod_perl-2.0.6.tar.gz mod_perl-2.0-current.tar.gz
115
    % tar -xzvf mod_perl-2.0.5.tar.gz
117
    % tar -xzvf mod_perl-2.0.6.tar.gz
116
    % rm /www/perl.apache.org/dist/mod_perl-2.0-current
118
    % rm /www/perl.apache.org/dist/mod_perl-2.0-current
117
    % ln -sf  mod_perl-2.0.5 mod_perl-2.0-current
119
    % ln -sf  mod_perl-2.0.6 mod_perl-2.0-current
118
120
119
  c. archive older releases (keep current + one prior release)
121
  c. archive older releases (keep current + one prior release)
120
122
121
    % mv /www/perl.apache.org/dist/mod_perl-2.0.3.tar.gz \
123
    % mv /www/perl.apache.org/dist/mod_perl-2.0.4.tar.gz \
122
         /www/perl.apache.org/dist/old
124
         /www/perl.apache.org/dist/old
123
    % mv /www/perl.apache.org/dist/mod_perl-2.0.3.tar.gz.asc \
125
    % mv /www/perl.apache.org/dist/mod_perl-2.0.4.tar.gz.asc \
124
         /www/perl.apache.org/dist/old
126
         /www/perl.apache.org/dist/old
125
    % rm -rf /www/perl.apache.org/dist/mod_perl-2.0.3
127
    % rm -rf /www/perl.apache.org/dist/mod_perl-2.0.4
126
128
127
  d. update the version and release date in the docs:
129
  d. update the version and release date in the docs:
128
    % vi modperl-docs/src/download/index_top.html 
130
    % vi modperl-docs/src/download/index_top.html 
129
    % vi modperl-docs/doap_Perl.rdf
131
    % vi modperl-docs/doap_Perl.rdf
130
132
131
     and commit.
133
     and commit.
132
    % svn ci -m "Releasing 2.0.5" \
134
    % svn ci -m "Releasing 2.0.6" \
133
          modperl-docs/src/download/index_top.html \
135
          modperl-docs/src/download/index_top.html \
134
          modperl-docs/doap_Perl.rdf
136
          modperl-docs/doap_Perl.rdf
135
     
137
     
Lines 139-144 Instructions for mod_perl 2.0 Release Manager Link Here
139
141
140
    % /home/perlwww/apache.org/modperl-docs/bin/site_build
142
    % /home/perlwww/apache.org/modperl-docs/bin/site_build
141
143
144
     You may need to sudo -H -u perlwww to cleanup any svn locks.
145
142
5. Upload the package to CPAN
146
5. Upload the package to CPAN
143
147
144
6. Tarball signing
148
6. Tarball signing
Lines 148-174 Instructions for mod_perl 2.0 Release Manager Link Here
148
152
149
  a. sign your local copy of the tarball:
153
  a. sign your local copy of the tarball:
150
154
151
    % gpg --detach-sign --armor mod_perl-2.0.5.tar.gz
155
    % gpg --detach-sign --armor mod_perl-2.0.6.tar.gz
152
156
153
    % pgps -b --armor mod_perl-2.0.5.tar.gz
157
    % pgps -b --armor mod_perl-2.0.6.tar.gz
154
158
155
  b. upload the generated sig file to people.apache.org:
159
  b. upload the generated sig file to people.apache.org:
156
160
157
    % scp mod_perl-2.0.5.tar.gz.asc people.apache.org:/www/perl.apache.org/dist/
161
    % scp mod_perl-2.0.6.tar.gz.asc people.apache.org:/www/perl.apache.org/dist/
158
    % ssh people.apache.org
162
    % ssh people.apache.org
159
    % cd /www/perl.apache.org/dist/
163
    % cd /www/perl.apache.org/dist/
160
    % chmod 0664 mod_perl-2.0.5.tar.gz.asc
164
    % chmod 0664 mod_perl-2.0.6.tar.gz.asc
161
    % ln -sf mod_perl-2.0.5.tar.gz.asc mod_perl-2.0-current.tar.gz.asc
165
    % ln -sf mod_perl-2.0.6.tar.gz.asc mod_perl-2.0-current.tar.gz.asc
162
166
163
  c. ask one of the other developers to double check the signature file
167
  c. ask one of the other developers to double check the signature file
164
     and tarball: download both files and verify the signature:
168
     and tarball: download both files and verify the signature:
165
169
166
    http://perl.apache.org/dist/mod_perl-2.0.5.tar.gz.asc
170
    http://perl.apache.org/dist/mod_perl-2.0.6.tar.gz.asc
167
    http://perl.apache.org/dist/mod_perl-2.0.5.tar.gz
171
    http://perl.apache.org/dist/mod_perl-2.0.6.tar.gz
168
172
169
    % gpg --verify mod_perl-2.0.5.tar.gz.asc
173
    % gpg --verify mod_perl-2.0.6.tar.gz.asc
170
174
171
    % pgpv mod_perl-2.0.5.tar.gz.asc
175
    % pgpv mod_perl-2.0.6.tar.gz.asc
172
176
173
  d. make sure that the files you just created are group rw so
177
  d. make sure that the files you just created are group rw so
174
     all the dist admins can make changes:
178
     all the dist admins can make changes:
Lines 182-191 Instructions for mod_perl 2.0 Release Manager Link Here
182
  a. unpack the package, update symlinks to the tarball and unpacked distro:
186
  a. unpack the package, update symlinks to the tarball and unpacked distro:
183
187
184
   % cd /www/www.apache.org/dist/perl/
188
   % cd /www/www.apache.org/dist/perl/
185
   % cp /www/perl.apache.org/dist/mod_perl-2.0.5.tar.gz* .
189
   % cp /www/perl.apache.org/dist/mod_perl-2.0.6.tar.gz* .
186
   % tar -xzvf mod_perl-2.0.5.tar.gz
190
   % tar -xzvf mod_perl-2.0.6.tar.gz
187
   % mv mod_perl-2.0.3.tar.gz* /www/archive.apache.org/dist/perl/
191
   % mv mod_perl-2.0.4.tar.gz* /www/archive.apache.org/dist/perl/
188
   % rm -rf mod_perl-2.0.3
192
   % rm -rf mod_perl-2.0.4
189
193
190
  b. make sure that the files you just created are group rw so
194
  b. make sure that the files you just created are group rw so
191
195
Lines 198-208 Instructions for mod_perl 2.0 Release Manager Link Here
198
202
199
  a. post ... to the modperl, announce lists
203
  a. post ... to the modperl, announce lists
200
  Note, to post to announce@, you must be sending from an apache.org address.
204
  Note, to post to announce@, you must be sending from an apache.org address.
201
  Subject: [ANNOUNCE] mod_perl 2.0.5 
205
  Subject: [ANNOUNCE] mod_perl 2.0.6 
202
     include 
206
     include 
203
  - link at perl.apache.org:
207
  - link at perl.apache.org:
204
    http://apache.org/dist/perl/mod_perl-2.0.5.tar.gz
208
    http://apache.org/dist/perl/mod_perl-2.0.6.tar.gz
205
    http://apache.org/dist/perl/mod_perl-2.0.5.tar.gz.asc (pgp sig)
209
    http://apache.org/dist/perl/mod_perl-2.0.6.tar.gz.asc (pgp sig)
206
  - MD5 sig (as it comes from CPAN upload announce).
210
  - MD5 sig (as it comes from CPAN upload announce).
207
  - the latest Changes
211
  - the latest Changes
208
212
Lines 213-219 Instructions for mod_perl 2.0 Release Manager Link Here
213
  b. edit ./Changes:
217
  b. edit ./Changes:
214
     - start a new item with incremented version + '-dev'
218
     - start a new item with incremented version + '-dev'
215
219
216
  =item 2.0.6-dev
220
  =item 2.0.7-dev
217
221
218
  c. add a release entry in STATUS
222
  c. add a release entry in STATUS
219
223
Lines 224-230 Instructions for mod_perl 2.0 Release Manager Link Here
224
228
225
  e. commit the changed files
229
  e. commit the changed files
226
230
227
     % svn ci -m "start 2.0.5-dev cycle" Changes lib/mod_perl2.pm \
231
     % svn ci -m "start 2.0.6-dev cycle" Changes lib/mod_perl2.pm \
228
       STATUS RELEASE
232
       STATUS RELEASE
229
233
230
10. Old Versions
234
10. Old Versions
(-)a/STATUS (+1 lines)
Lines 3-8 mod_perl 2.0 STATUS: -*-text-*- Link Here
3
3
4
Release:
4
Release:
5
--------
5
--------
6
   2.000.05   : Released Feb 07, 2011
6
   2.000.04   : Released Apr 16, 2008
7
   2.000.04   : Released Apr 16, 2008
7
   2.000.03   : Released Nov 29, 2006
8
   2.000.03   : Released Nov 29, 2006
8
   2.000.02   : Released Oct 20, 2005
9
   2.000.02   : Released Oct 20, 2005
(-)a/lib/Apache2/Build.pm (-6 / +66 lines)
Lines 27-32 use File::Basename; Link Here
27
use ExtUtils::Embed ();
27
use ExtUtils::Embed ();
28
use File::Copy ();
28
use File::Copy ();
29
29
30
BEGIN {				# check for a sane ExtUtils::Embed
31
    unless ($ENV{MP_USE_MY_EXTUTILS_EMBED}) {
32
	my ($version, $path)=(ExtUtils::Embed->VERSION,
33
			      $INC{q{ExtUtils/Embed.pm}});
34
	my $msg=<<"EOF";
35
I have found ExtUtils::Embed $version at
36
37
  $path
38
39
This is probably not the right one for this perl version. Please make sure
40
there is only one version of this module installed and that it is the one
41
that comes with this perl version.
42
43
If you insist on using the ExtUtils::Embed as is set the environment
44
variable MP_USE_MY_EXTUTILS_EMBED=1 and try again.
45
46
EOF
47
	if (eval {require Module::CoreList}) {
48
	    my $req=$Module::CoreList::version{$]}->{q/ExtUtils::Embed/};
49
	    die "Please repair your Module::CoreList" unless $req;
50
	    unless ($version eq $req) {
51
		$msg.=("Details: expecting ExtUtils::Embed $req ".
52
		       "(according to Module::CoreList)\n\n");
53
		die $msg;
54
	    }
55
	}
56
	else {
57
	    my $req=$Config{privlib}.'/ExtUtils/Embed.pm';
58
	    unless ($path eq $req) {
59
		$msg.="Details: expecting ExtUtils::Embed at $req\n\n";
60
		die $msg;
61
	    }
62
	}
63
    }
64
}
65
30
use constant IS_MOD_PERL_BUILD => grep 
66
use constant IS_MOD_PERL_BUILD => grep 
31
    { -e "$_/Makefile.PL" && -e "$_/lib/mod_perl2.pm" } qw(. ..);
67
    { -e "$_/Makefile.PL" && -e "$_/lib/mod_perl2.pm" } qw(. ..);
32
68
Lines 240-246 sub caller_package { Link Here
240
}
276
}
241
277
242
my %threaded_mpms = map { $_ => 1 }
278
my %threaded_mpms = map { $_ => 1 }
243
        qw(worker winnt beos mpmt_os2 netware leader perchild threadpool);
279
        qw(worker winnt beos mpmt_os2 netware leader perchild threadpool
280
           dynamic);
244
sub mpm_is_threaded {
281
sub mpm_is_threaded {
245
    my $self = shift;
282
    my $self = shift;
246
    my $mpm_name = $self->mpm_name();
283
    my $mpm_name = $self->mpm_name();
Lines 255-261 sub mpm_name { Link Here
255
    # XXX: hopefully apxs will work on win32 one day
292
    # XXX: hopefully apxs will work on win32 one day
256
    return $self->{mpm_name} = 'winnt' if WIN32;
293
    return $self->{mpm_name} = 'winnt' if WIN32;
257
294
258
    my $mpm_name = $self->apxs('-q' => 'MPM_NAME');
295
    my $mpm_name;
296
297
    # httpd >= 2.3
298
    if ($self->httpd_version_as_int =~ m/^2[3-9]\d+/) {
299
        $mpm_name = 'dynamic';
300
    }
301
    else {
302
        $mpm_name = $self->apxs('-q' => 'MPM_NAME');
303
    }
259
304
260
    # building against the httpd source dir
305
    # building against the httpd source dir
261
    unless (($mpm_name and $self->httpd_is_source_tree)) {
306
    unless (($mpm_name and $self->httpd_is_source_tree)) {
Lines 1108-1114 sub apr_bindir { Link Here
1108
1153
1109
sub apr_generation {
1154
sub apr_generation {
1110
    my ($self) = @_;
1155
    my ($self) = @_;
1111
    return $self->httpd_version_as_int =~ m/2[1-9]\d+/ ? 1 : 0;
1156
1157
    my $httpd_v = $self->httpd_version_as_int;
1158
1159
    if ($httpd_v =~ m/2[4-9]\d+/) {
1160
        return 2;
1161
    }
1162
    elsif ($httpd_v =~ m/2[1-3]\d+/) {
1163
        return 1;
1164
    }
1165
    else {
1166
        return;
1167
    }
1112
}
1168
}
1113
1169
1114
# returns an array of apr/apu linking flags (--link-ld --libs) if found
1170
# returns an array of apr/apu linking flags (--link-ld --libs) if found
Lines 1168-1174 sub apru_config_path { Link Here
1168
        $self->{$key} = $self->{$mp_key};
1224
        $self->{$key} = $self->{$mp_key};
1169
    }
1225
    }
1170
1226
1171
    my $config = $self->apr_generation ? "$what-1-config" : "$what-config";
1227
    my $apr_generation = $self->apr_generation;
1228
    my $config = $apr_generation ? "$what-${apr_generation}-config" : "$what-config";
1172
1229
1173
    if (!$self->{$key}) {
1230
    if (!$self->{$key}) {
1174
        my @tries = ();
1231
        my @tries = ();
Lines 1536-1543 sub make_tools { Link Here
1536
1593
1537
    require ExtUtils::MakeMaker;
1594
    require ExtUtils::MakeMaker;
1538
    my $mm = bless { @mm_init_vars }, 'MM';
1595
    my $mm = bless { @mm_init_vars }, 'MM';
1539
    $mm->init_main;
1596
1540
    $mm->init_others;
1597
    # Fake initialize MakeMaker
1598
    foreach my $m (qw(init_main init_others init_tools)) {
1599
        $mm->$m() if $mm->can($m);
1600
    }
1541
1601
1542
    for (qw(rm_f mv ld ar cp test_f)) {
1602
    for (qw(rm_f mv ld ar cp test_f)) {
1543
        my $val = $mm->{"\U$_"};
1603
        my $val = $mm->{"\U$_"};
(-)a/lib/ModPerl/MM.pm (-11 / +12 lines)
Lines 69-78 sub add_dep_after { Link Here
69
    $$string =~ s/($targ\s+::.*?$after_targ)/$1 $add/;
69
    $$string =~ s/($targ\s+::.*?$after_targ)/$1 $add/;
70
}
70
}
71
71
72
my $build;
73
72
sub build_config {
74
sub build_config {
73
    my $key = shift;
75
    my $key = shift;
74
    require Apache2::Build;
76
    require Apache2::Build;
75
    my $build = Apache2::Build->build_config;
77
    $build ||= Apache2::Build->build_config;
76
    return $build unless $key;
78
    return $build unless $key;
77
    $build->{$key};
79
    $build->{$key};
78
}
80
}
Lines 97-111 sub my_import { Link Here
97
my @default_opts = qw(CCFLAGS LIBS INC OPTIMIZE LDDLFLAGS TYPEMAPS);
99
my @default_opts = qw(CCFLAGS LIBS INC OPTIMIZE LDDLFLAGS TYPEMAPS);
98
my @default_dlib_opts = qw(OTHERLDFLAGS);
100
my @default_dlib_opts = qw(OTHERLDFLAGS);
99
my @default_macro_opts = ();
101
my @default_macro_opts = ();
100
my $b = build_config();
101
my %opts = (
102
my %opts = (
102
    CCFLAGS      => sub { $b->{MODPERL_CCOPTS}                        },
103
    CCFLAGS      => sub { $build->{MODPERL_CCOPTS}                            },
103
    LIBS         => sub { join ' ', $b->apache_libs, $b->modperl_libs },
104
    LIBS         => sub { join ' ', $build->apache_libs, $build->modperl_libs },
104
    INC          => sub { $b->inc;                                    },
105
    INC          => sub { $build->inc;                                        },
105
    OPTIMIZE     => sub { $b->perl_config('optimize');                },
106
    OPTIMIZE     => sub { $build->perl_config('optimize');                    },
106
    LDDLFLAGS    => sub { $b->perl_config('lddlflags');               },
107
    LDDLFLAGS    => sub { $build->perl_config('lddlflags');                   },
107
    TYPEMAPS     => sub { $b->typemaps;                               },
108
    TYPEMAPS     => sub { $build->typemaps;                                   },
108
    OTHERLDFLAGS => sub { $b->otherldflags;                           },
109
    OTHERLDFLAGS => sub { $build->otherldflags;                               },
109
);
110
);
110
111
111
sub get_def_opt {
112
sub get_def_opt {
Lines 128-134 sub WriteMakefile { Link Here
128
        $eu_mm_mv_all_methods_overriden++;
129
        $eu_mm_mv_all_methods_overriden++;
129
    }
130
    }
130
131
131
    my $build = build_config();
132
    $build ||= build_config();
132
    my_import(__PACKAGE__);
133
    my_import(__PACKAGE__);
133
134
134
    # set top-level WriteMakefile's values if weren't set already
135
    # set top-level WriteMakefile's values if weren't set already
Lines 158-164 sub WriteMakefile { Link Here
158
sub ModPerl::MM::MY::post_initialize {
159
sub ModPerl::MM::MY::post_initialize {
159
    my $self = shift;
160
    my $self = shift;
160
161
161
    my $build = build_config();
162
    $build ||= build_config();
162
    my $pm = $self->{PM};
163
    my $pm = $self->{PM};
163
164
164
    while (my ($k, $v) = each %PM) {
165
    while (my ($k, $v) = each %PM) {
(-)a/lib/ModPerl/WrapXS.pm (-1 / +8 lines)
Lines 155-163 EOF Link Here
155
155
156
            my $retval = $return_type eq 'void' ?
156
            my $retval = $return_type eq 'void' ?
157
              ["", ""] : ["RETVAL = ", "OUTPUT:\n    RETVAL\n"];
157
              ["", ""] : ["RETVAL = ", "OUTPUT:\n    RETVAL\n"];
158
158
            
159
            my $avoid_warning = "";
160
            if (@$args and not $passthru) {
161
                $avoid_warning = "    /* avoiding -Wall warnings */\n";
162
                $avoid_warning .= join "\n",
163
                    (map "    $_->{name} = $_->{name};", @$args), "";
164
            }
159
            $code .= <<EOF;
165
            $code .= <<EOF;
160
    CODE:
166
    CODE:
167
$avoid_warning
161
    $retval->[0]$dispatch($thx$parms);
168
    $retval->[0]$dispatch($thx$parms);
162
169
163
    $retval->[1]
170
    $retval->[1]
(-)a/lib/mod_perl2.pm (-1 / +1 lines)
Lines 19-25 use 5.006; Link Here
19
use strict;
19
use strict;
20
20
21
BEGIN {
21
BEGIN {
22
    our $VERSION = "2.000005";
22
    our $VERSION = "2.000006";
23
    our $VERSION_TRIPLET;
23
    our $VERSION_TRIPLET;
24
24
25
    if ($VERSION =~ /(\d+)\.(\d\d\d)(\d+)/) {
25
    if ($VERSION =~ /(\d+)\.(\d\d\d)(\d+)/) {
(-)a/src/modules/perl/mod_perl.c (-3 / +3 lines)
Lines 439-451 int modperl_init_vhost(server_rec *s, apr_pool_t *p, Link Here
439
void modperl_init(server_rec *base_server, apr_pool_t *p)
439
void modperl_init(server_rec *base_server, apr_pool_t *p)
440
{
440
{
441
    server_rec *s;
441
    server_rec *s;
442
    modperl_config_srv_t *base_scfg;
443
    PerlInterpreter *base_perl;
442
    PerlInterpreter *base_perl;
444
443
#ifdef MP_TRACE
445
    base_scfg = modperl_config_srv_get(base_server);
444
    modperl_config_srv_t *base_scfg = modperl_config_srv_get(base_server);
446
445
447
    MP_TRACE_d_do(MpSrv_dump_flags(base_scfg,
446
    MP_TRACE_d_do(MpSrv_dump_flags(base_scfg,
448
                                   base_server->server_hostname));
447
                                   base_server->server_hostname));
448
#endif /* MP_TRACE */
449
449
450
#ifndef USE_ITHREADS
450
#ifndef USE_ITHREADS
451
    if (modperl_threaded_mpm()) {
451
    if (modperl_threaded_mpm()) {
(-)a/src/modules/perl/modperl_const.c (-1 / +1 lines)
Lines 51-57 static void new_constsub(pTHX_ constants_lookup lookup, Link Here
51
            gv_init(alias, caller_stash, name, name_len, TRUE);
51
            gv_init(alias, caller_stash, name, name_len, TRUE);
52
        }
52
        }
53
53
54
        GvCV_set(alias, GvCV(*gvp));
54
        GvCV_set(alias, MUTABLE_CV(SvREFCNT_inc(GvCV(*gvp))));
55
    }
55
    }
56
}
56
}
57
57
(-)a/src/modules/perl/modperl_error.c (-1 / +1 lines)
Lines 78-84 void modperl_croak(pTHX_ apr_status_t rc, const char* func) Link Here
78
    }
78
    }
79
79
80
    if (SvTRUE(ERRSV)) {
80
    if (SvTRUE(ERRSV)) {
81
        Perl_croak(aTHX_ "%s", SvPV_nolen(ERRSV));
81
        Perl_croak(aTHX_ Nullch);
82
    }
82
    }
83
83
84
    stash = gv_stashpvn("APR::Error", 10, FALSE);
84
    stash = gv_stashpvn("APR::Error", 10, FALSE);
(-)a/src/modules/perl/modperl_error.h (+16 lines)
Lines 45-48 void modperl_croak(pTHX_ apr_status_t rc, const char* func); Link Here
45
        }                                                    \
45
        }                                                    \
46
    } STMT_END
46
    } STMT_END
47
47
48
#define MP_RUN_CROAK_RESET_OK(s, rc_run, func) STMT_START               \
49
    {                                                                   \
50
        apr_status_t rc = rc_run;                                       \
51
        if (rc != APR_SUCCESS) {                                        \
52
            if (APR_STATUS_IS_ECONNRESET(rc) ||                         \
53
                APR_STATUS_IS_ECONNABORTED(rc)) {                       \
54
                ap_log_error(APLOG_MARK, APLOG_INFO, 0, s,              \
55
                             "%s got: %s", func,                        \
56
                             modperl_error_strerror(aTHX_ rc));         \
57
            }                                                           \
58
            else {                                                      \
59
                modperl_croak(aTHX_ rc, func);                          \
60
            }                                                           \
61
        }                                                               \
62
    } STMT_END
63
48
#endif /* MODPERL_ERROR_H */
64
#endif /* MODPERL_ERROR_H */
(-)a/src/modules/perl/modperl_filter.c (-20 / +4 lines)
Lines 472-495 static int modperl_run_filter_init(ap_filter_t *f, Link Here
472
    return status;
472
    return status;
473
}
473
}
474
474
475
476
#define MP_RUN_CROAK_RESET_OK(func)                                     \
477
    {                                                                   \
478
        apr_status_t rc = func(filter);                                 \
479
        if (rc != APR_SUCCESS) {                                        \
480
            if (APR_STATUS_IS_ECONNRESET(rc) ||                         \
481
                APR_STATUS_IS_ECONNABORTED(rc)) {                       \
482
                ap_log_error(APLOG_MARK, APLOG_INFO, 0, s,              \
483
                             "Apache2::Filter internal flush got: %s",  \
484
                             modperl_error_strerror(aTHX_ rc));         \
485
            }                                                           \
486
            else {                                                      \
487
                modperl_croak(aTHX_ rc,                                 \
488
                              "Apache2::Filter internal flush");        \
489
            }                                                           \
490
        }                                                               \
491
    }
492
493
int modperl_run_filter(modperl_filter_t *filter)
475
int modperl_run_filter(modperl_filter_t *filter)
494
{
476
{
495
    AV *args = Nullav;
477
    AV *args = Nullav;
Lines 563-572 int modperl_run_filter(modperl_filter_t *filter) Link Here
563
            apr_brigade_destroy(filter->bb_in);
545
            apr_brigade_destroy(filter->bb_in);
564
            filter->bb_in = NULL;
546
            filter->bb_in = NULL;
565
        }
547
        }
566
        MP_RUN_CROAK_RESET_OK(modperl_input_filter_flush);
548
        MP_RUN_CROAK_RESET_OK(s, modperl_input_filter_flush(filter),
549
                              "Apache2::Filter internal flush");
567
    }
550
    }
568
    else {
551
    else {
569
        MP_RUN_CROAK_RESET_OK(modperl_output_filter_flush);
552
        MP_RUN_CROAK_RESET_OK(s, modperl_output_filter_flush(filter),
553
                              "Apache2::Filter internal flush");
570
    }
554
    }
571
555
572
    MP_FILTER_RESTORE_ERRSV(errsv);
556
    MP_FILTER_RESTORE_ERRSV(errsv);
(-)a/src/modules/perl/modperl_io_apache.c (-2 / +3 lines)
Lines 169-176 PerlIOApache_flush(pTHX_ PerlIO *f) Link Here
169
                                  rcfg->wbucket->outbuf,
169
                                  rcfg->wbucket->outbuf,
170
                                  rcfg->wbucket->outcnt));
170
                                  rcfg->wbucket->outcnt));
171
171
172
    MP_RUN_CROAK(modperl_wbucket_flush(rcfg->wbucket, FALSE),
172
    MP_RUN_CROAK_RESET_OK(st->r->server,
173
                 ":Apache2 IO flush");
173
                          modperl_wbucket_flush(rcfg->wbucket, FALSE),
174
                          ":Apache2 IO flush");
174
175
175
    return 0;
176
    return 0;
176
}
177
}
(-)a/src/modules/perl/modperl_module.c (-12 / +4 lines)
Lines 297-304 modperl_module_config_create_obj(pTHX_ Link Here
297
    }
297
    }
298
298
299
    MP_TRACE_c(MP_FUNC, "%s cfg=0x%lx for %s.%s",
299
    MP_TRACE_c(MP_FUNC, "%s cfg=0x%lx for %s.%s",
300
               method, (unsigned long)cfg,
300
               method ? modperl_mgv_last_name(method) : "NULL",
301
               mname, parms->cmd->name);
301
               (unsigned long)cfg, mname, parms->cmd->name);
302
302
303
    /* used by merge functions to get a Perl interp */
303
    /* used by merge functions to get a Perl interp */
304
    cfg->server = parms->server;
304
    cfg->server = parms->server;
Lines 741-748 static const char *modperl_module_add_cmds(apr_pool_t *p, server_rec *s, Link Here
741
741
742
static void modperl_module_insert(module *modp)
742
static void modperl_module_insert(module *modp)
743
{
743
{
744
    module *m;
745
746
    /*
744
    /*
747
     * insert after mod_perl, rather the top of the list.
745
     * insert after mod_perl, rather the top of the list.
748
     * (see ap_add_module; does not insert into ap_top_module list if
746
     * (see ap_add_module; does not insert into ap_top_module list if
Lines 750-763 static void modperl_module_insert(module *modp) Link Here
750
     * this way, modperl config merging happens before this module.
748
     * this way, modperl config merging happens before this module.
751
     */
749
     */
752
750
753
    for (m = ap_top_module; m; m=m->next) {
751
    modp->next = perl_module.next;
754
        if (m == &perl_module) {
752
    perl_module.next = modp;
755
            module *next = m->next;
756
            m->next = modp;
757
            modp->next = next;
758
            break;
759
        }
760
    }
761
}
753
}
762
754
763
#define MP_isGV(gv) (gv && isGV(gv))
755
#define MP_isGV(gv) (gv && isGV(gv))
(-)a/src/modules/perl/modperl_pcw.c (-3 / +15 lines)
Lines 27-33 void ap_pcw_walk_location_config(apr_pool_t *pconf, server_rec *s, Link Here
27
                                 ap_pcw_dir_cb_t dir_cb, void *data)
27
                                 ap_pcw_dir_cb_t dir_cb, void *data)
28
{
28
{
29
    int i;
29
    int i;
30
    ap_conf_vector_t **urls = (ap_conf_vector_t **)sconf->sec_url->elts;
30
    ap_conf_vector_t **urls;
31
32
    if( !sconf->sec_url ) return;
33
34
    urls = (ap_conf_vector_t **)sconf->sec_url->elts;
31
35
32
    for (i = 0; i < sconf->sec_url->nelts; i++) {
36
    for (i = 0; i < sconf->sec_url->nelts; i++) {
33
        core_dir_config *conf =
37
        core_dir_config *conf =
Lines 46-52 void ap_pcw_walk_directory_config(apr_pool_t *pconf, server_rec *s, Link Here
46
                                  ap_pcw_dir_cb_t dir_cb, void *data)
50
                                  ap_pcw_dir_cb_t dir_cb, void *data)
47
{
51
{
48
    int i;
52
    int i;
49
    ap_conf_vector_t **dirs = (ap_conf_vector_t **)sconf->sec_dir->elts;
53
    ap_conf_vector_t **dirs;
54
55
    if( !sconf->sec_dir ) return;
56
57
    dirs = (ap_conf_vector_t **)sconf->sec_dir->elts;
50
58
51
    for (i = 0; i < sconf->sec_dir->nelts; i++) {
59
    for (i = 0; i < sconf->sec_dir->nelts; i++) {
52
        core_dir_config *conf =
60
        core_dir_config *conf =
Lines 65-71 void ap_pcw_walk_files_config(apr_pool_t *pconf, server_rec *s, Link Here
65
                              ap_pcw_dir_cb_t dir_cb, void *data)
73
                              ap_pcw_dir_cb_t dir_cb, void *data)
66
{
74
{
67
    int i;
75
    int i;
68
    ap_conf_vector_t **dirs = (ap_conf_vector_t **)dconf->sec_file->elts;
76
    ap_conf_vector_t **dirs;
77
78
    if( !dconf->sec_file ) return;
79
80
    dirs = (ap_conf_vector_t **)dconf->sec_file->elts;
69
81
70
    for (i = 0; i < dconf->sec_file->nelts; i++) {
82
    for (i = 0; i < dconf->sec_file->nelts; i++) {
71
        core_dir_config *conf =
83
        core_dir_config *conf =
(-)a/src/modules/perl/modperl_perl.c (-1 / +2 lines)
Lines 55-61 void modperl_perl_core_global_init(pTHX) Link Here
55
55
56
    while (cglobals->name) {
56
    while (cglobals->name) {
57
        GV *gv = gv_fetchpv(cglobals->core_name, TRUE, SVt_PVCV);
57
        GV *gv = gv_fetchpv(cglobals->core_name, TRUE, SVt_PVCV);
58
        GvCV_set(gv, get_cv(cglobals->sub_name, TRUE));
58
        GvCV_set(gv,
59
                 MUTABLE_CV(SvREFCNT_inc(get_cv(cglobals->sub_name, TRUE))));
59
        GvIMPORTED_CV_on(gv);
60
        GvIMPORTED_CV_on(gv);
60
        cglobals++;
61
        cglobals++;
61
    }
62
    }
(-)a/src/modules/perl/modperl_perl_global.c (+3 lines)
Lines 338-343 modperl_perl_global_gvhv_restore(pTHX_ modperl_perl_global_gvhv_t *gvhv) Link Here
338
     */
338
     */
339
    MP_magical_untie(gvhv->tmphv, mg_flags);
339
    MP_magical_untie(gvhv->tmphv, mg_flags);
340
    SvREFCNT_dec(gvhv->tmphv);
340
    SvREFCNT_dec(gvhv->tmphv);
341
342
    /* avoiding -Wall warning */
343
    mg_flags = mg_flags;
341
}
344
}
342
345
343
static void
346
static void
(-)a/src/modules/perl/modperl_svptr_table.c (-4 / +7 lines)
Lines 30-36 Link Here
30
#ifdef USE_ITHREADS
30
#ifdef USE_ITHREADS
31
31
32
#if MP_PERL_BRANCH(5, 6)
32
#if MP_PERL_BRANCH(5, 6)
33
#   define my_sv_dup(s, p) sv_dup(s)
33
#   define my_sv_dup(s, p) SvREFCNT_inc(sv_dup(s))
34
34
35
typedef struct {
35
typedef struct {
36
    AV *stashes;
36
    AV *stashes;
Lines 39-45 typedef struct { Link Here
39
} CLONE_PARAMS;
39
} CLONE_PARAMS;
40
40
41
#else
41
#else
42
#   define my_sv_dup(s, p) sv_dup(s, p)
42
#   ifdef sv_dup_inc
43
#       define my_sv_dup(s, p) sv_dup_inc(s, p)
44
#   else
45
#       define my_sv_dup(s, p) SvREFCNT_inc(sv_dup(s, p))
46
#   endif
43
#endif
47
#endif
44
48
45
/*
49
/*
Lines 89-96 PTR_TBL_t *modperl_svptr_table_clone(pTHX_ PerlInterpreter *proto_perl, Link Here
89
            /* key is just a pointer we do not modify, no need to copy */
93
            /* key is just a pointer we do not modify, no need to copy */
90
            dst_ent->oldval = src_ent->oldval;
94
            dst_ent->oldval = src_ent->oldval;
91
95
92
            dst_ent->newval =
96
            dst_ent->newval = my_sv_dup((SV*)src_ent->newval, &parms);
93
                SvREFCNT_inc(my_sv_dup((SV*)src_ent->newval, &parms));
94
        }
97
        }
95
    }
98
    }
96
99
(-)a/src/modules/perl/modperl_tipool.c (-1 / +1 lines)
Lines 328-336 static void modperl_tipool_putback_base(modperl_tipool_t *tipool, Link Here
328
    MP_TRACE_i(MP_FUNC, "0x%lx now available (%d in use, %d running)",
328
    MP_TRACE_i(MP_FUNC, "0x%lx now available (%d in use, %d running)",
329
               (unsigned long)listp->data, tipool->in_use, tipool->size);
329
               (unsigned long)listp->data, tipool->in_use, tipool->size);
330
330
331
    modperl_tipool_broadcast(tipool);
331
    if (tipool->in_use == (tipool->cfg->max - 1)) {
332
    if (tipool->in_use == (tipool->cfg->max - 1)) {
332
        /* hurry up, another thread may be blocking */
333
        /* hurry up, another thread may be blocking */
333
        modperl_tipool_broadcast(tipool);
334
        modperl_tipool_unlock(tipool);
334
        modperl_tipool_unlock(tipool);
335
        return;
335
        return;
336
    }
336
    }
(-)a/t/api/err_headers_out.t (+16 lines)
Lines 19-24 my $location = '/TestAPI__err_headers_out'; Link Here
19
19
20
    ok t_cmp $res->code, 200, "OK";
20
    ok t_cmp $res->code, 200, "OK";
21
21
22
    # HTTP::Headers 6.00 makes the next 2 tests fail. When the response comes
23
    # in the header name is stored as "x-err_headers_out". But when it is to
24
    # be read below it is referred as "x-err-headers-out" and hence not found.
25
    local $HTTP::Headers::TRANSLATE_UNDERSCORE=
26
	$HTTP::Headers::TRANSLATE_UNDERSCORE;
27
    undef $HTTP::Headers::TRANSLATE_UNDERSCORE
28
	if defined HTTP::Headers->VERSION and HTTP::Headers->VERSION==6.00;
29
22
    ok t_cmp $res->header('X-err_headers_out'), "err_headers_out",
30
    ok t_cmp $res->header('X-err_headers_out'), "err_headers_out",
23
        "X-err_headers_out: made it";
31
        "X-err_headers_out: made it";
24
32
Lines 36-41 my $location = '/TestAPI__err_headers_out'; Link Here
36
44
37
    ok t_cmp $res->code, 404, "not found";
45
    ok t_cmp $res->code, 404, "not found";
38
46
47
    # HTTP::Headers 6.00 makes this test fail. When the response comes in
48
    # the header name is stored as "x-err_headers_out". But when it is to
49
    # be read below it is referred as "x-err-headers-out" and hence not found.
50
    local $HTTP::Headers::TRANSLATE_UNDERSCORE=
51
	$HTTP::Headers::TRANSLATE_UNDERSCORE;
52
    undef $HTTP::Headers::TRANSLATE_UNDERSCORE
53
	if defined HTTP::Headers->VERSION and HTTP::Headers->VERSION==6.00;
54
39
    ok t_cmp $res->header('X-err_headers_out'), "err_headers_out",
55
    ok t_cmp $res->header('X-err_headers_out'), "err_headers_out",
40
        "X-err_headers_out: made it";
56
        "X-err_headers_out: made it";
41
57
(-)a/t/conf/extra.conf.in (+4 lines)
Lines 73-78 PerlModule TestExit::FromPerlModule Link Here
73
</IfModule>
73
</IfModule>
74
<IfModule mod_env.c>
74
<IfModule mod_env.c>
75
    SetEnv TMPDIR @t_logs@
75
    SetEnv TMPDIR @t_logs@
76
77
    # pass ld_library_path for non standard lib locations
78
    # [rt.cpan.org #66085]
79
    PassEnv LD_LIBRARY_PATH
76
</IfModule>
80
</IfModule>
77
# </sandbox-friendly>
81
# </sandbox-friendly>
78
82
(-)a/t/conf/post_config_startup.pl (-14 / +23 lines)
Lines 98-117 sub test_perl_ithreads { Link Here
98
}
98
}
99
99
100
sub test_server_shutdown_cleanup_register {
100
sub test_server_shutdown_cleanup_register {
101
    # we can't really test the functionality since it happens at
101
    Apache2::ServerUtil::server_shutdown_cleanup_register sub {
102
    # server shutdown, when the test suite has finished its run
102
       warn <<'EOF';
103
    # so just check that we can register the cleanup and that it
103
*** done with server_shutdown_cleanup_register                               ***
104
    # doesn't segfault
104
********************************************************************************
105
    Apache2::ServerUtil::server_shutdown_cleanup_register(sub { Apache2::Const::OK });
105
EOF
106
106
    };
107
    # replace the sub with the following to get some visual debug
107
108
    # should log cnt:1 on -start, oncand cnt: 2 -stop followed by cnt: 1)
108
    Apache2::ServerUtil::server_shutdown_cleanup_register sub {
109
    #Apache2::ServerUtil::server_shutdown_cleanup_register( sub {
109
       die "testing server_shutdown_cleanup_register\n";
110
    #    my $cnt = Apache2::ServerUtil::restart_count();
110
    };
111
    #    open my $fh, ">>/tmp/out" or die "$!";
111
112
    #    print $fh "cnt: $cnt\n";
112
    Apache2::ServerUtil::server_shutdown_cleanup_register sub {
113
    #    close $fh;
113
        warn <<'EOF';
114
    #});
114
********************************************************************************
115
*** This is a test for Apache2::ServerUtil::server_shutdown_cleanup_register ***
116
*** Following a line consisting only of * characters there should be a line  ***
117
*** containing                                                               ***
118
***     "cleanup died: testing server_shutdown_cleanup_register".            ***
119
*** The next line should then read                                           ***
120
***     "done with server_shutdown_cleanup_register"                         ***
121
********************************************************************************
122
EOF
123
    };
115
}
124
}
116
125
117
sub ModPerl::Test::exit_handler {
126
sub ModPerl::Test::exit_handler {
(-)a/t/filter/TestFilter/out_str_reverse.pm (-1 / +10 lines)
Lines 16-27 use TestCommon::Utils (); Link Here
16
use Apache2::Const -compile => qw(OK M_POST);
16
use Apache2::Const -compile => qw(OK M_POST);
17
17
18
use constant BUFF_LEN => 2;
18
use constant BUFF_LEN => 2;
19
use constant signature => "Reversed by mod_perl 2.0\n";
19
20
20
sub handler {
21
sub handler {
21
    my $f = shift;
22
    my $f = shift;
22
    #warn "called\n";
23
    #warn "called\n";
23
24
24
    my $leftover = $f->ctx;
25
    my $leftover = $f->ctx;
26
27
    # We are about to change the length of the response body. Hence, we
28
    # have to adjust the content-length header.
29
    unless (defined $leftover) { # 1st invocation
30
	$f->r->headers_out->{'Content-Length'}+=length signature
31
	    if exists $f->r->headers_out->{'Content-Length'};
32
    }
33
25
    while ($f->read(my $buffer, BUFF_LEN)) {
34
    while ($f->read(my $buffer, BUFF_LEN)) {
26
        #warn "buffer: [$buffer]\n";
35
        #warn "buffer: [$buffer]\n";
27
        $buffer = $leftover . $buffer if defined $leftover;
36
        $buffer = $leftover . $buffer if defined $leftover;
Lines 34-40 sub handler { Link Here
34
43
35
    if ($f->seen_eos) {
44
    if ($f->seen_eos) {
36
        $f->print(scalar reverse $leftover) if defined $leftover;
45
        $f->print(scalar reverse $leftover) if defined $leftover;
37
        $f->print("Reversed by mod_perl 2.0\n");
46
        $f->print(signature);
38
    }
47
    }
39
    else {
48
    else {
40
        $f->ctx($leftover) if defined $leftover;
49
        $f->ctx($leftover) if defined $leftover;
(-)a/t/lib/TestAPRlib/pool.pm (-6 / +29 lines)
Lines 11-17 use APR::Pool (); Link Here
11
use APR::Table ();
11
use APR::Table ();
12
12
13
sub num_of_tests {
13
sub num_of_tests {
14
    return 75;
14
    return 77;
15
}
15
}
16
16
17
sub test {
17
sub test {
Lines 333-353 sub test { Link Here
333
    {
333
    {
334
        my $p = APR::Pool->new;
334
        my $p = APR::Pool->new;
335
        $p->cleanup_register('TestAPR::pool::some_non_existing_sub', 1);
335
        $p->cleanup_register('TestAPR::pool::some_non_existing_sub', 1);
336
        eval { $p->destroy };
336
337
        ok t_cmp($@,
337
        my @warnings;
338
        local $SIG{__WARN__} = sub {push @warnings, @_};
339
        $p->destroy;
340
341
        ok t_cmp($warnings[0],
338
                 qr/Undefined subroutine/,
342
                 qr/Undefined subroutine/,
339
                 "non existing function");
343
                 "non existing function");
340
    }
344
    }
341
    {
345
    {
342
        my $p = APR::Pool->new;
346
        my $p = APR::Pool->new;
343
        $p->cleanup_register(\&non_existing1, 1);
347
        $p->cleanup_register(\&non_existing1, 1);
344
        eval { $p->destroy };
348
345
        ok t_cmp($@,
349
        my @warnings;
350
        local $SIG{__WARN__} = sub {push @warnings, @_};
351
        $p->destroy;
352
353
        ok t_cmp($warnings[0],
346
                 qr/Undefined subroutine/,
354
                 qr/Undefined subroutine/,
347
                 "non existing function");
355
                 "non existing function");
348
    }
356
    }
349
357
350
358
    # cleanups throwing exceptions
359
    {
360
        my $p = APR::Pool->new;
361
        $p->cleanup_register(sub {die "1\n"}, 1);
362
        $p->cleanup_register(sub {die "2\n"}, 1);
363
364
        my @warnings;
365
        local $SIG{__WARN__} = sub {push @warnings, @_};
366
        local $@="to be preserved";
367
        undef $p;
368
369
        ok t_cmp(\@warnings,
370
                 [map "APR::Pool: cleanup died: $_\n", 2, 1],
371
                 "exceptions thrown by cleanups");
372
        ok t_cmp($@, "to be preserved", '$@ is preserved');
373
    }
351
374
352
    ### $p->clear ###
375
    ### $p->clear ###
353
    {
376
    {
(-)a/t/protocol/TestProtocol/pseudo_http.pm (+2 lines)
Lines 165-170 __END__ Link Here
165
          AuthUserFile @ServerRoot@/htdocs/protocols/basic-auth
165
          AuthUserFile @ServerRoot@/htdocs/protocols/basic-auth
166
      </IfModule>
166
      </IfModule>
167
167
168
      AuthName TestProtocol::pseudo_http
169
      AuthType Basic
168
      Require user stas
170
      Require user stas
169
      Satisfy any
171
      Satisfy any
170
172
(-)a/t/response/TestAPI/add_config.pm (-1 / +1 lines)
Lines 121-127 __END__ Link Here
121
# APACHE_TEST_CONFIG_ORDER 950
121
# APACHE_TEST_CONFIG_ORDER 950
122
<NoAutoConfig>
122
<NoAutoConfig>
123
    <VirtualHost TestAPI::add_config>
123
    <VirtualHost TestAPI::add_config>
124
        PerlModule TestAPI::add_config
124
        PerlLoadModule TestAPI::add_config
125
        AccessFileName htaccess
125
        AccessFileName htaccess
126
        SetHandler modperl
126
        SetHandler modperl
127
        <Directory @DocumentRoot@>
127
        <Directory @DocumentRoot@>
(-)a/t/response/TestAPI/request_rec.pm (-3 / +9 lines)
Lines 57-64 sub handler { Link Here
57
57
58
    ok $r->protocol =~ /http/i;
58
    ok $r->protocol =~ /http/i;
59
59
60
    # HTTP 1.0
60
    # LWP >=6.00 uses HTTP/1.1, other HTTP/1.0
61
    ok t_cmp $r->proto_num, 1000, 't->proto_num';
61
    ok t_cmp $r->proto_num, 1000+substr($r->the_request, -1),
62
	't->proto_num';
62
63
63
    ok t_cmp lc($r->hostname), lc($r->get_server_name), '$r->hostname';
64
    ok t_cmp lc($r->hostname), lc($r->get_server_name), '$r->hostname';
64
65
Lines 124-130 sub handler { Link Here
124
125
125
        ok t_cmp $r->args, $args, '$r->args';
126
        ok t_cmp $r->args, $args, '$r->args';
126
127
127
        ok t_cmp $r->the_request, "GET $base_uri$path_info?$args HTTP/1.0",
128
	# LWP uses HTTP/1.1 since 6.00
129
        ok t_cmp $r->the_request, qr!GET
130
				     \x20
131
				     \Q$base_uri$path_info\E\?\Q$args\E
132
				     \x20
133
				     HTTP/1\.\d!x,
128
            '$r->the_request';
134
            '$r->the_request';
129
135
130
        {
136
        {
(-)a/t/response/TestAPI/server_const.pm (-10 / +12 lines)
Lines 24-30 sub handler { Link Here
24
24
25
    my $r = shift;
25
    my $r = shift;
26
26
27
    plan $r, tests => 5;
27
    plan $r, tests => 6;
28
28
29
    # test Apache2::ServerUtil constant subroutines
29
    # test Apache2::ServerUtil constant subroutines
30
30
Lines 36-55 sub handler { Link Here
36
             $built,
36
             $built,
37
             'Apache2::ServerUtil::get_server_built()');
37
             'Apache2::ServerUtil::get_server_built()');
38
38
39
    ok t_cmp(Apache2::ServerUtil::get_server_description,
39
    my $server_descr = Apache2::ServerUtil::get_server_description;
40
             $version,
40
    ok t_cmp($server_descr, qr/^\Q$version\E/,
41
             'Apache2::ServerUtil::get_server_description()');
41
             'Apache2::ServerUtil::get_server_description()');
42
42
43
    my $server_version = Apache2::ServerUtil::get_server_version;
43
    # added via $s->add_version_component in t/conf/modperl_extra.pl
44
    ok t_cmp($version,
44
    ok t_cmp($server_descr, qr!\bworld domination series/2\.0\b!,
45
             qr/^$server_version/,
45
             'Apache2::ServerUtil::get_server_description() -- component');
46
             'Apache2::ServerUtil::get_server_version()');
47
46
48
    my $server_banner = Apache2::ServerUtil::get_server_banner;
47
    # assuming ServerTokens Full (default) the banner equals description
49
    ok t_cmp($version,
48
    ok t_cmp(Apache2::ServerUtil::get_server_banner, $server_descr,
50
             qr/^$server_banner/,
51
             'Apache2::ServerUtil::get_server_banner()');
49
             'Apache2::ServerUtil::get_server_banner()');
52
50
51
    # version is just an alias for banner
52
    ok t_cmp(Apache2::ServerUtil::get_server_version, $server_descr,
53
             'Apache2::ServerUtil::get_server_version()');
54
53
    Apache2::Const::OK;
55
    Apache2::Const::OK;
54
}
56
}
55
57
(-)a/todo/2.0.5 (-10 lines)
Lines 1-10 Link Here
1
SHOW STOPPERS
2
====================
3
- Windows Segfaults [needs windows developer owner, ]
4
- MANIFEST verifications [needs detail, ]
5
- rt.cpan.org PRs [pgollucci, phred, ]
6
7
NICE TO HAVE
8
=============
9
- Smolder, https://issues.apache.org/jira/browse/INFRA-1612 [pgollucci, ]
10
(-)a/todo/2.0.6 (+10 lines)
Line 0 Link Here
1
SHOW STOPPERS
2
====================
3
- Windows Segfaults [needs windows developer owner, ]
4
- MANIFEST verifications [needs detail, ]
5
- rt.cpan.org PRs [pgollucci, phred, ]
6
7
NICE TO HAVE
8
=============
9
- Smolder, https://issues.apache.org/jira/browse/INFRA-1612 [pgollucci, ]
10
(-)a/xs/APR/Pool/APR__Pool.h (-4 / +6 lines)
Lines 285-290 static apr_status_t mpxs_cleanup_run(void *data) Link Here
285
    }
285
    }
286
    PUTBACK;
286
    PUTBACK;
287
287
288
    save_gp(PL_errgv, 1);       /* local *@ */
288
    count = call_sv(cdata->cv, G_SCALAR|G_EVAL);
289
    count = call_sv(cdata->cv, G_SCALAR|G_EVAL);
289
290
290
    SPAGAIN;
291
    SPAGAIN;
Lines 293-298 static apr_status_t mpxs_cleanup_run(void *data) Link Here
293
        (void)POPs; /* the return value is ignored */
294
        (void)POPs; /* the return value is ignored */
294
    }
295
    }
295
296
297
    if (SvTRUE(ERRSV)) {
298
        Perl_warn(aTHX_ "APR::Pool: cleanup died: %s", 
299
                  SvPV_nolen(ERRSV));
300
    }
301
296
    PUTBACK;
302
    PUTBACK;
297
    FREETMPS;LEAVE;
303
    FREETMPS;LEAVE;
298
304
Lines 311-320 static apr_status_t mpxs_cleanup_run(void *data) Link Here
311
    }
317
    }
312
#endif
318
#endif
313
319
314
    if (SvTRUE(ERRSV)) {
315
        Perl_croak(aTHX_ SvPV_nolen(ERRSV));
316
    }
317
318
    /* the return value is ignored by apr_pool_destroy anyway */
320
    /* the return value is ignored by apr_pool_destroy anyway */
319
    return APR_SUCCESS;
321
    return APR_SUCCESS;
320
}
322
}
(-)a/xs/Apache2/RequestIO/Apache2__RequestIO.h (-2 / +3 lines)
Lines 179-186 void mpxs_Apache2__RequestRec_rflush(pTHX_ I32 items, Link Here
179
               rcfg->wbucket->outcnt,
179
               rcfg->wbucket->outcnt,
180
               apr_pstrmemdup(rcfg->wbucket->pool, rcfg->wbucket->outbuf,
180
               apr_pstrmemdup(rcfg->wbucket->pool, rcfg->wbucket->outbuf,
181
                              rcfg->wbucket->outcnt));
181
                              rcfg->wbucket->outcnt));
182
    MP_RUN_CROAK(modperl_wbucket_flush(rcfg->wbucket, TRUE),
182
    MP_RUN_CROAK_RESET_OK(r->server,
183
                 "Apache2::RequestIO::rflush");
183
                          modperl_wbucket_flush(rcfg->wbucket, TRUE),
184
                          "Apache2::RequestIO::rflush");
184
}
185
}
185
186
186
static MP_INLINE long mpxs_ap_get_client_block(pTHX_ request_rec *r,
187
static MP_INLINE long mpxs_ap_get_client_block(pTHX_ request_rec *r,
(-)a/xs/Apache2/RequestUtil/Apache2__RequestUtil.h (-6 lines)
Lines 154-165 int mpxs_Apache2__RequestRec_location_merge(request_rec *r, Link Here
154
                                                    &core_module);
154
                                                    &core_module);
155
155
156
        if (strEQ(entry->d, location)) {
156
        if (strEQ(entry->d, location)) {
157
            if (!entry->ap_auth_type) {
158
                entry->ap_auth_type = "Basic";
159
            }
160
            if (!entry->ap_auth_name) {
161
                entry->ap_auth_name = apr_pstrdup(p, location);
162
            }
163
            r->per_dir_config =
157
            r->per_dir_config =
164
                ap_merge_per_dir_configs(p, s->lookup_defaults, sec[i]);
158
                ap_merge_per_dir_configs(p, s->lookup_defaults, sec[i]);
165
            return 1;
159
            return 1;
(-)a/xs/Apache2/ServerUtil/Apache2__ServerUtil.h (-13 / +14 lines)
Lines 53-58 static apr_status_t mpxs_cleanup_run(void *data) Link Here
53
    mpxs_cleanup2_t *cdata = (mpxs_cleanup2_t *)data;
53
    mpxs_cleanup2_t *cdata = (mpxs_cleanup2_t *)data;
54
#ifdef USE_ITHREADS
54
#ifdef USE_ITHREADS
55
    dTHXa(cdata->perl);
55
    dTHXa(cdata->perl);
56
    PERL_SET_CONTEXT(aTHX);
56
#endif
57
#endif
57
    dSP;
58
    dSP;
58
59
Lines 63-68 static apr_status_t mpxs_cleanup_run(void *data) Link Here
63
    }
64
    }
64
    PUTBACK;
65
    PUTBACK;
65
66
67
    save_gp(PL_errgv, 1);       /* local *@ */
66
    count = call_sv(cdata->cv, G_SCALAR|G_EVAL);
68
    count = call_sv(cdata->cv, G_SCALAR|G_EVAL);
67
69
68
    SPAGAIN;
70
    SPAGAIN;
Lines 71-76 static apr_status_t mpxs_cleanup_run(void *data) Link Here
71
        (void)POPs; /* the return value is ignored */
73
        (void)POPs; /* the return value is ignored */
72
    }
74
    }
73
75
76
    if (SvTRUE(ERRSV)) {
77
        Perl_warn(aTHX_ "Apache2::ServerUtil: cleanup died: %s",
78
                  SvPV_nolen(ERRSV));
79
    }
80
74
    PUTBACK;
81
    PUTBACK;
75
    FREETMPS;LEAVE;
82
    FREETMPS;LEAVE;
76
83
Lines 79-88 static apr_status_t mpxs_cleanup_run(void *data) Link Here
79
        SvREFCNT_dec(cdata->arg);
86
        SvREFCNT_dec(cdata->arg);
80
    }
87
    }
81
88
82
    if (SvTRUE(ERRSV)) {
83
        Perl_croak(aTHX_ SvPV_nolen(ERRSV));
84
    }
85
86
    /* the return value is ignored by apr_pool_destroy anyway */
89
    /* the return value is ignored by apr_pool_destroy anyway */
87
    return APR_SUCCESS;
90
    return APR_SUCCESS;
88
}
91
}
Lines 185-190 void mpxs_Apache2__ServerRec_add_config(pTHX_ server_rec *s, SV *lines) Link Here
185
    }
188
    }
186
}
189
}
187
190
191
#define mpxs_Apache2__ServerRec_get_server_banner         \
192
    ap_get_server_banner()
193
#define mpxs_Apache2__ServerRec_get_server_description    \
194
    ap_get_server_description()
195
#define mpxs_Apache2__ServerRec_get_server_version        \
196
    ap_get_server_version()
197
188
static void mpxs_Apache2__ServerUtil_BOOT(pTHX)
198
static void mpxs_Apache2__ServerUtil_BOOT(pTHX)
189
{
199
{
190
    newCONSTSUB(PL_defstash, "Apache2::ServerUtil::server_root",
200
    newCONSTSUB(PL_defstash, "Apache2::ServerUtil::server_root",
Lines 192-204 static void mpxs_Apache2__ServerUtil_BOOT(pTHX) Link Here
192
202
193
    newCONSTSUB(PL_defstash, "Apache2::ServerUtil::get_server_built",
203
    newCONSTSUB(PL_defstash, "Apache2::ServerUtil::get_server_built",
194
                newSVpv(ap_get_server_built(), 0));
204
                newSVpv(ap_get_server_built(), 0));
195
196
    newCONSTSUB(PL_defstash, "Apache2::ServerUtil::get_server_version",
197
                newSVpv(ap_get_server_version(), 0));
198
199
    newCONSTSUB(PL_defstash, "Apache2::ServerUtil::get_server_banner",
200
                newSVpv(ap_get_server_banner(), 0));
201
202
    newCONSTSUB(PL_defstash, "Apache2::ServerUtil::get_server_description",
203
                newSVpv(ap_get_server_description(), 0));
204
}
205
}
(-)a/xs/Apache2/SubProcess/Apache2__SubProcess.h (-2 / +2 lines)
Lines 135-141 MP_STATIC XS(MPXS_modperl_spawn_proc_prog) Link Here
135
    const char *usage = "Usage: spawn_proc_prog($r, $command, [\\@argv])";
135
    const char *usage = "Usage: spawn_proc_prog($r, $command, [\\@argv])";
136
136
137
    if (items < 2) {
137
    if (items < 2) {
138
        Perl_croak(aTHX_ usage);
138
        Perl_croak(aTHX_ "%s", usage);
139
    }
139
    }
140
140
141
    SP -= items;
141
    SP -= items;
Lines 156-162 MP_STATIC XS(MPXS_modperl_spawn_proc_prog) Link Here
156
                av_items = len+1;
156
                av_items = len+1;
157
            }
157
            }
158
            else {
158
            else {
159
                Perl_croak(aTHX_ usage);
159
                Perl_croak(aTHX_ "%s", usage);
160
            }
160
            }
161
        }
161
        }
162
162
(-)a/xs/maps/apache2_functions.map (-3 / +3 lines)
Lines 165-170 MODULE=Apache2::ServerUtil PACKAGE=Apache2::ServerRec BOOT=1 Link Here
165
MODULE=Apache2::ServerUtil   PACKAGE=Apache2::ServerUtil
165
MODULE=Apache2::ServerUtil   PACKAGE=Apache2::ServerUtil
166
 ap_exists_config_define
166
 ap_exists_config_define
167
 ap_server_root_relative | | p, fname=""
167
 ap_server_root_relative | | p, fname=""
168
 ap_get_server_banner
169
 ap_get_server_description
170
 ap_get_server_version
168
171
169
MODULE=Apache2::ServerUtil   PACKAGE=guess
172
MODULE=Apache2::ServerUtil   PACKAGE=guess
170
 ap_error_log2stderr
173
 ap_error_log2stderr
Lines 175-183 MODULE=Apache2::ServerUtil PACKAGE=guess Link Here
175
#however it is not exported on win32
178
#however it is not exported on win32
176
!ap_get_local_host
179
!ap_get_local_host
177
~ap_get_server_built
180
~ap_get_server_built
178
~ap_get_server_version
179
~ap_get_server_banner
180
~ap_get_server_description
181
~ap_server_root
181
~ap_server_root
182
182
183
183

Return to bug 410453