[Auto-merge of all httpd24threading revisions (which includes all threading revisions) back into trunk, which is now possible, having already (auto-)merged all httpd24 revision back :-)]

Merged revision(s) 1151159-1537408, 1537477-1602100 from perl/modperl/branches/httpd24threading:
porting modperl to httpd 2.4
........
Initialized merge tracking via "svnmerge" with revisions "1-1151156" from 
https://svn.eu.apache.org/repos/asf/perl/modperl/trunk

........
Initialized merge tracking via "svnmerge" with revisions "1-1151159" from 
https://svn.eu.apache.org/repos/asf/perl/modperl/branches/httpd24

........
Allow for multiline Perl statements in the "#_if_" minilanguage in
map files like xs/maps/apache2_functions.map

Before this change one would have to write

#_if_ do { long perl expression; another perl expression }

After it can span over multiple lines:

#_if_ do {                     \
  long perl expression;        \
  another perl expression;     \
}

........
As of httpd 2.4 the MPM becomes a loadable module. Thus, modperl should
in principle require a threaded perl always. But if the admin knows that
only prefork will be used he can call "perl Makefile.PL NONTHREADED_OK=1"
to have the build process accept a non-threaded perl.

........
make modperl compilable with httpd 2.3.14.

........
ap_default_type() is gone in httpd 2.3.2
........
Avoid -Wall warning when mg_flags isn't used.


........
When generating XS code, include var = var; declarations on the arguments,
since we don't know if they will be used, and we want to keep -Wall builds
succeeding.


........
Silence a compiler warning when MP_TRACE is not enabled


........
Adjust for latest ExtUtils::MakeMaker internal change. We must call init_tools when
it is available.

Reference: https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker/commit/f4904b4ce499b7f0c420efae69f44e19fe7dd12f


........
Apache 2.4 and onwards doesn't require linking the MPM module directly in
the httpd binary anymore. APXS lost the MPM_NAME query, so we can't assume
a given MPM anymore. Introduce a fake MPM 'dynamic' to represent this. 

Borrowed from the 2.4 branch


........
Discover apr-2-config from Apache 2.4 onwards.


........
Merged revisions 1125476,1125479,1145161,1213838,1213841,1213902,1221285,1221359,1222775 via svnmerge from 
https://svn.eu.apache.org/repos/asf/perl/modperl/trunk

........
  r1125476 | torsten | 2011-05-20 19:22:24 +0200 (Fri, 20 May 2011) | 1 line
  
  adopt the Perl_sv_dup() changes in Perl 5.14
........
  r1125479 | torsten | 2011-05-20 19:32:03 +0200 (Fri, 20 May 2011) | 1 line
  
  again, forgot about Changes in commit 1125476
........
  r1145161 | torsten | 2011-07-11 15:07:46 +0200 (Mon, 11 Jul 2011) | 1 line
  
  move <LimitExcept> into a <Directory />. In httpd-2.3 it is not allowed in server config context
........
  r1213838 | gozer | 2011-12-13 19:33:18 +0100 (Tue, 13 Dec 2011) | 3 lines
  
  Avoid -Wall warning when mg_flags isn't used.
........
  r1213841 | gozer | 2011-12-13 19:34:16 +0100 (Tue, 13 Dec 2011) | 5 lines
  
  When generating XS code, include var = var; declarations on the arguments,
  since we don't know if they will be used, and we want to keep -Wall builds
  succeeding.
........
  r1213902 | gozer | 2011-12-13 21:04:15 +0100 (Tue, 13 Dec 2011) | 3 lines
  
  Silence a compiler warning when MP_TRACE is not enabled
........
  r1221285 | gozer | 2011-12-20 15:40:21 +0100 (Tue, 20 Dec 2011) | 6 lines
  
  Adjust for latest ExtUtils::MakeMaker internal change. We must call init_tools when
  it is available.
  
  Reference: https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker/commit/f4904b4ce499b7f0c420efae69f44e19fe7dd12f
........
  r1221359 | gozer | 2011-12-20 18:22:31 +0100 (Tue, 20 Dec 2011) | 7 lines
  
  Apache 2.4 and onwards doesn't require linking the MPM module directly in
  the httpd binary anymore. APXS lost the MPM_NAME query, so we can't assume
  a given MPM anymore. Introduce a fake MPM 'dynamic' to represent this. 
  
  Borrowed from the 2.4 branch
........
  r1222775 | gozer | 2011-12-23 19:20:27 +0100 (Fri, 23 Dec 2011) | 3 lines
  
  Discover apr-2-config from Apache 2.4 onwards.
........

........
Fix a small bug in a debugging message in modperl_module.c. It tried to
print a modperl_mgv_t* as %s.

........
Merged revisions 1241435 via svnmerge from 
https://svn.eu.apache.org/repos/asf/perl/modperl/trunk

........
  r1241435 | torsten | 2012-02-07 13:00:45 +0100 (Tue, 07 Feb 2012) | 3 lines
  
  Fix a small bug in a debugging message in modperl_module.c. It tried to
  print a modperl_mgv_t* as %s.
........

........
modperl_interp_pool_select() when used to create or merge dir-configs
at runtime may pull the interpreter from the wrong pool if the request's
server is a vhost with a separate interpreter pool.

........
reverting change 1145161
........
Blocked revisions 1241873 via svnmerge

........
  r1241873 | torsten | 2012-02-08 12:46:27 +0100 (Wed, 08 Feb 2012) | 1 line
  
  reverting change 1145161
........

........
improve MP_TRACE output a bit: include current perl context for
threaded perls

........
rename assert() => ap_assert()
........
similar to r1241583: make sure r->server is used to identify the interpreter
pool to pull from at runtime.

........
comment added
........
remove a bit of code complexity

modperl_module.c contains these 2 lines:

	interp = modperl_interp_pool_select(p, s);
	MP_PERL_CONTEXT_STORE_OVERRIDE(interp->perl);

The latter decodes as

	orig_perl = PERL_GET_CONTEXT;
	aTHX = interp->perl;
	PERL_SET_CONTEXT(aTHX);

Now, modperl_interp_pool_select() already calls PERL_SET_CONTEXT with the
newly allocated interpreter. So, we get

	PERL_SET_CONTEXT(interp->perl);
	orig_perl = PERL_GET_CONTEXT;
	aTHX = interp->perl;
	PERL_SET_CONTEXT(aTHX);

But this is the same as

	interp = modperl_interp_pool_select(p, s);
	aTHX = interp->perl;

........
ap_assert => MP_ASSERT (depends on MP_DEBUG)
........
- introduce a few preprocessor macros aiming at a more robust interpreter
  handling (not finished yet).
- deleting some cruft from ancient perl versions.


........
Improve interpreter management

The goal of this change is to detect earlier cases when a perl interpreter
may be used by multiple threads simultaneously. This is done partly by
wrapping the interpreter allocation functions into preprocessor macros
to provide consistent trace messages and more important to reset aTHX to
NULL when the interpreter is put back.

Currently interpreter are pulled from the pool and set as context via
PERL_SET_CONTEXT. But when an interpreter is put back to the pool the
context is not reset to NULL. In an ideal world this should not be
necessary because the interpreter will not be used again. But for
debugging it's quite useful to put NULL in the perl context upon
putting back the interpreter. Thus, the program will segfault if the
thread wants to use an interpreter that already has been declared as
free.

That way a few errors where found and hopefully fixed:
  * modperl_filter_f_cleanup() frees the perl-level filter context but was
    called after the interpreter has already been put back.
  * similar situation in request time config MERGE operations. They also
    register a cleanup handler that uses the  perl interpreter. But they
    do not make sure that the interpreter is bound to the request at least
    up to the time the cleanup is invoked.

Currently available macros include:
  * MP_dINTERP
    declares the variables aTHX (my_perl) and interp

  * MP_INTERPa(r, c, s)
    selects an interpreter via modperl_interp_select and assigns aTHX and
    interp

  * MP_dINTERPa(r, c, s)
    combination of MP_dINTERP and MP_INTERPa

  * MP_INTERP_POOLa(p, s)
    like MP_INTERPa but calls modperl_interp_pool_select

  * MP_dINTERP_POOLa(p, s)
    combination of MP_dINTERP and MP_INTERP_POOLa    

  * MP_INTERP_PUTBACK(interp, thx)
    puts the interpreter back via modperl_interp_unselect and assigns NULL
    to aTHX

  * MP_INTERP_REFCNT_inc(interp)
    increments interp->refcnt

  * MP_INTERP_REFCNT_dec(interp)
    alias for MP_INTERP_PUTBACK(interp, NULL)

  * MP_ASSERT_CONTEXT(thx)
    checks for PERL_GET_CONTEXT==thx

The same set of macros/functions is now also used for pre-runtime stuff.
However, this part is not yet finished.

........
move interp allocation out of modperl_hash_handlers*()

These functions are called in a loop (modperl_mgv_hash_handlers()). Now,
the interp is allocated outside the loop.

........
drop unused MP_dTHX and MP_uTHX macros
........
eliminate MP_dSCFG_dTHX
........
Correct the initialization of the build config in ModPerl::MM, simply borrowing the style of ModPerl::BuildMM to do so.

........
Fix 2 SV REFCNT bugs:

- modperl_perl_core_global_init(), the aliasing GV references the aliased
  CV. Thus, it should increment the REFCNT.
- new_constsub() in modperl_const.c, same story.

The bug has been there for years. Only starting with perl 5.14 it became
visible by messages like this in the error_log:

  Attempt to free unreferenced scalar: SV 0x7fc218, 
      Perl interpreter: 0x7cfdb0 during global destruction.

........
Merged revisions 1243923,1244184 via svnmerge from 
https://svn.eu.apache.org/repos/asf/perl/modperl/trunk

........
  r1243923 | stevehay | 2012-02-14 15:04:05 +0100 (Tue, 14 Feb 2012) | 2 lines
  
  Correct the initialization of the build config in ModPerl::MM, simply borrowing the style of ModPerl::BuildMM to do so.
........
  r1244184 | torsten | 2012-02-14 20:29:11 +0100 (Tue, 14 Feb 2012) | 12 lines
  
  Fix 2 SV REFCNT bugs:
  
  - modperl_perl_core_global_init(), the aliasing GV references the aliased
    CV. Thus, it should increment the REFCNT.
  - new_constsub() in modperl_const.c, same story.
  
  The bug has been there for years. Only starting with perl 5.14 it became
  visible by messages like this in the error_log:
  
    Attempt to free unreferenced scalar: SV 0x7fc218, 
        Perl interpreter: 0x7cfdb0 during global destruction.
........

........
suppress "perl=..." output in MP_TRACE output before the first interpreter has been started
........
avoid hard-wired $(MAKE) options
........
pass MP_APXS and MP_AP_PREFIX to submodule Makefile.PLs as environment variables
........
Merged revisions 1245946,1290839 via svnmerge from 
https://svn.eu.apache.org/repos/asf/perl/modperl/trunk

........
  r1245946 | torsten | 2012-02-18 16:38:49 +0100 (Sat, 18 Feb 2012) | 1 line
  
  avoid hard-wired $(MAKE) options
........
  r1290839 | torsten | 2012-02-18 19:31:38 +0100 (Sat, 18 Feb 2012) | 1 line
  
  pass MP_APXS and MP_AP_PREFIX to submodule Makefile.PLs as environment variables
........

........
fix missing base_scfg declaration in modperl_init() if USE_ITHREADS && !MP_TRACE
........
Ensure that MP_APXS is set when building on Win32 with MP_AP_PREFIX,
otherwise the bundled Reload and SizeLimit builds will fail to find a
properly configured Test environment.
........
Fix a race condition in our tipool management.
See http://www.gossamer-threads.com/lists/modperl/dev/104026
Patch submitted by: SalusaSecondus <salusa@nationstates.net>

........
Do not stringify $@ upon exception propagation.
........
fix a few false positive warnings when compiled with -Werror=format-security (reported by Niko Tyni)
........
Pool cleanup functions must not longjmp. Catch these exceptions and turn
them into warnings.

Affected methods:
  APR::Pool->cleanup_register
  Apache2::ServerUtil->server_shutdown_cleanup_register

........
Adopt modperl_pcw.c changes from httpd24 branch.

........
add another pool cleanup exception test
........
Move code after declarations to keep MSVC++ compiler happy.
........
attribute rc4 changes
........
add ifdef's for MUTABLE_CV usage to preserve perl 5.8.5 compatibility


........
Add changes entry

........
Releasing 2.0.6
........
Releasing 2.0.6
........
start 2.0.7-dev cycle
........
Apply patch from rt.cpan.org #77129 to fix breakage caused by removal of PL_uid et al from perl 5.16.0.

........
Yep, I think we're stable by now ;)

........
Releasing 2.0.7
........
start 2.0.8-dev cycle
........
Remove all uses of deprecated symbols no longer used by core perl and now only defined when PERL_CORE is not defined for backwards compatibility with CPAN extensions still making use of them:
MEMBER_TO_FPTR, New, NEWSV, Newz, Null, Nullav, Nullch, Nullcv, Nullfp, Nullgv, Nullhv, Nullsv, PL_dirty, PL_na.

We actually (and arguably, wrongly) define PERL_CORE for an optimization in certain cases (but not when large files support is enabled, hence this doesn't happen often) and therefore don't get the definitions of these legacy symbols in that case. This commit fixes that, so that mod_perl can once again be built without large files support, but ideally our usage of PERL_CORE should be removed anyway.
........
Fix commit 1362399: PL_phase/PERL_PHASE_DESTRUCT is only available in newer perls, so restore use of PL_dirty for older perls (where it was always available, regardless of whether PERL_CORE was defined).
........
Update Changes file for commits 1362399 and 1362409.
........
* src/modules/perl/modperl_interp.c (modperl_interp_select): Fix for httpd 2.4.

Submitted by: Jan Kaluza <jkaluza redhat.com>, jorton

........
* src/modules/perl/modperl_apache_compat.h: Fix definition of
  MP_HTTPD_OVERRIDE_OPTS_DEFAULT for 2.4.

Obtained from: branches/httpd24
Submitted by: torsten

........
* src/modules/perl/modperl_apache_compat.h: Fix version test.

........
* src/modules/perl/modperl_apache_includes.h: Use 2.4 logging API.

Submitted by: Stefan Fritsch <sf sfritsch.de>, jorton

........
* src/modules/perl/modperl_apache_compat.h: Add mp_add_loaded_module
  wrapper function.

* src/modules/perl/modperl_module.c (modperl_module_add): Use it.

Obtained from: branches/httpd24
Submitted by: torsten

........
Revert change accidentally included in r1410298.

........
Fix OPT_INCNOEXEC/OPT_INC_WITH_EXEC handling.

Obtained from: branches/httpd24

........
* src/modules/perl/modperl_config.c (svav_getstr): Adjust for 2.4 API.

Obtained from: branches/httpd24
Submitted by: torsten

........
CScan gets rather confused if cpp's line number markers appear in the middle
of a function declaration

Submitted by: sf

........
Ignore more exports from 2.4/trunk which break "make source_scan".

Submitted by: sf

........
* lib/Apache2/ParseSource.pm (include_dirs): Pick up APR include dir
  iff different to httpd include dir.

Submitted by: Jan Kaluza <jkaluza redhat.com>, jorton

........
* src/modules/perl/modperl_apr_includes.h: Pick up new APR-util error
  codes.

Submitted by: Jan Kaluza <jkaluza redhat.com>, jorton

........
* xs/Apache2/Log/Apache2__Log.h,
  src/modules/perl/modperl_apache_compat.h: Adapt logging for 2.4 API.

Obtained from: branches/httpd24
Submitted by: torsten

........
* lib/ModPerl/Code.pm: Add another constant for 2.4.

Submitted by: sf

........
* lib/Apache2/ParseSource.pm: Pick up PROXYREQ_ constants.

........
Fix use of unixd_conifg for 2.4.

Obtained from: branches/httpd24
Submitted by: torsten

........
* lib/ModPerl/TypeMap.pm (typedefs_code, sv_convert_code):
  Produce output in sorted order for ease of diff across
  invocations.

........
Merged revisions 1213838,1213841,1213902,1221285,1221359,1222775,1241435,1241873,1243923,1244184,1245946,1290839,1291667,1299429,1299669,1301966,1302389,1302431,1302463,1311623,1311963,1328477,1328479,1330023,1330345,1330548,1344224,1346710,1346712,1346720,1362399,1362409,1362412,1410264,1410291,1410293,1410295,1410298-1410299,1410314,1410316,1410327,1410329,1410343,1410345,1410400,1410407,1410425,1410427,1419582 via svnmerge from 
https://svn.apache.org/repos/asf/perl/modperl/trunk

........
  r1213838 | gozer | 2011-12-13 19:33:18 +0100 (Tue, 13 Dec 2011) | 3 lines
  
  Avoid -Wall warning when mg_flags isn't used.
........
  r1213841 | gozer | 2011-12-13 19:34:16 +0100 (Tue, 13 Dec 2011) | 5 lines
  
  When generating XS code, include var = var; declarations on the arguments,
  since we don't know if they will be used, and we want to keep -Wall builds
  succeeding.
........
  r1213902 | gozer | 2011-12-13 21:04:15 +0100 (Tue, 13 Dec 2011) | 3 lines
  
  Silence a compiler warning when MP_TRACE is not enabled
........
  r1221285 | gozer | 2011-12-20 15:40:21 +0100 (Tue, 20 Dec 2011) | 6 lines
  
  Adjust for latest ExtUtils::MakeMaker internal change. We must call init_tools when
  it is available.
  
  Reference: https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker/commit/f4904b4ce499b7f0c420efae69f44e19fe7dd12f
........
  r1221359 | gozer | 2011-12-20 18:22:31 +0100 (Tue, 20 Dec 2011) | 7 lines
  
  Apache 2.4 and onwards doesn't require linking the MPM module directly in
  the httpd binary anymore. APXS lost the MPM_NAME query, so we can't assume
  a given MPM anymore. Introduce a fake MPM 'dynamic' to represent this. 
  
  Borrowed from the 2.4 branch
........
  r1222775 | gozer | 2011-12-23 19:20:27 +0100 (Fri, 23 Dec 2011) | 3 lines
  
  Discover apr-2-config from Apache 2.4 onwards.
........
  r1241435 | torsten | 2012-02-07 13:00:45 +0100 (Tue, 07 Feb 2012) | 3 lines
  
  Fix a small bug in a debugging message in modperl_module.c. It tried to
  print a modperl_mgv_t* as %s.
........
  r1241873 | torsten | 2012-02-08 12:46:27 +0100 (Wed, 08 Feb 2012) | 1 line
  
  reverting change 1145161
........
  r1243923 | stevehay | 2012-02-14 15:04:05 +0100 (Tue, 14 Feb 2012) | 2 lines
  
  Correct the initialization of the build config in ModPerl::MM, simply borrowing the style of ModPerl::BuildMM to do so.
........
  r1244184 | torsten | 2012-02-14 20:29:11 +0100 (Tue, 14 Feb 2012) | 12 lines
  
  Fix 2 SV REFCNT bugs:
  
  - modperl_perl_core_global_init(), the aliasing GV references the aliased
    CV. Thus, it should increment the REFCNT.
  - new_constsub() in modperl_const.c, same story.
  
  The bug has been there for years. Only starting with perl 5.14 it became
  visible by messages like this in the error_log:
  
    Attempt to free unreferenced scalar: SV 0x7fc218, 
        Perl interpreter: 0x7cfdb0 during global destruction.
........
  r1245946 | torsten | 2012-02-18 16:38:49 +0100 (Sat, 18 Feb 2012) | 1 line
  
  avoid hard-wired $(MAKE) options
........
  r1290839 | torsten | 2012-02-18 19:31:38 +0100 (Sat, 18 Feb 2012) | 1 line
  
  pass MP_APXS and MP_AP_PREFIX to submodule Makefile.PLs as environment variables
........
  r1291667 | stevehay | 2012-02-21 09:59:19 +0100 (Tue, 21 Feb 2012) | 3 lines
  
  Ensure that MP_APXS is set when building on Win32 with MP_AP_PREFIX,
  otherwise the bundled Reload and SizeLimit builds will fail to find a
  properly configured Test environment.
........
  r1299429 | torsten | 2012-03-11 20:09:47 +0100 (Sun, 11 Mar 2012) | 4 lines
  
  Fix a race condition in our tipool management.
  See http://www.gossamer-threads.com/lists/modperl/dev/104026
  Patch submitted by: SalusaSecondus <salusa@nationstates.net>
........
  r1299669 | torsten | 2012-03-12 14:27:30 +0100 (Mon, 12 Mar 2012) | 1 line
  
  Do not stringify $@ upon exception propagation.
........
  r1301966 | torsten | 2012-03-17 18:25:01 +0100 (Sat, 17 Mar 2012) | 1 line
  
  fix a few false positive warnings when compiled with -Werror=format-security (reported by Niko Tyni)
........
  r1302389 | torsten | 2012-03-19 13:03:52 +0100 (Mon, 19 Mar 2012) | 7 lines
  
  Pool cleanup functions must not longjmp. Catch these exceptions and turn
  them into warnings.
  
  Affected methods:
    APR::Pool->cleanup_register
    Apache2::ServerUtil->server_shutdown_cleanup_register
........
  r1302431 | torsten | 2012-03-19 14:47:18 +0100 (Mon, 19 Mar 2012) | 2 lines
  
  Adopt modperl_pcw.c changes from httpd24 branch.
........
  r1302463 | torsten | 2012-03-19 15:13:26 +0100 (Mon, 19 Mar 2012) | 1 line
  
  add another pool cleanup exception test
........
  r1311623 | stevehay | 2012-04-10 10:03:21 +0200 (Tue, 10 Apr 2012) | 1 line
  
  Move code after declarations to keep MSVC++ compiler happy.
........
  r1311963 | phred | 2012-04-10 22:05:01 +0200 (Tue, 10 Apr 2012) | 1 line
  
  attribute rc4 changes
........
  r1328477 | aprime | 2012-04-20 20:47:05 +0200 (Fri, 20 Apr 2012) | 3 lines
  
  add ifdef's for MUTABLE_CV usage to preserve perl 5.8.5 compatibility
........
  r1328479 | aprime | 2012-04-20 21:07:44 +0200 (Fri, 20 Apr 2012) | 2 lines
  
  Add changes entry
........
  r1330023 | phred | 2012-04-24 23:31:35 +0200 (Tue, 24 Apr 2012) | 1 line
  
  Releasing 2.0.6
........
  r1330345 | phred | 2012-04-25 17:30:13 +0200 (Wed, 25 Apr 2012) | 1 line
  
  Releasing 2.0.6
........
  r1330548 | phred | 2012-04-25 22:42:13 +0200 (Wed, 25 Apr 2012) | 1 line
  
  start 2.0.7-dev cycle
........
  r1344224 | stevehay | 2012-05-30 14:24:43 +0200 (Wed, 30 May 2012) | 2 lines
  
  Apply patch from rt.cpan.org #77129 to fix breakage caused by removal of PL_uid et al from perl 5.16.0.
........
  r1346710 | phred | 2012-06-06 04:16:19 +0200 (Wed, 06 Jun 2012) | 2 lines
  
  Yep, I think we're stable by now ;)
........
  r1346712 | phred | 2012-06-06 04:19:11 +0200 (Wed, 06 Jun 2012) | 1 line
  
  Releasing 2.0.7
........
  r1346720 | phred | 2012-06-06 04:44:23 +0200 (Wed, 06 Jun 2012) | 1 line
  
  start 2.0.8-dev cycle
........
  r1362399 | stevehay | 2012-07-17 10:14:58 +0200 (Tue, 17 Jul 2012) | 4 lines
  
  Remove all uses of deprecated symbols no longer used by core perl and now only defined when PERL_CORE is not defined for backwards compatibility with CPAN extensions still making use of them:
  MEMBER_TO_FPTR, New, NEWSV, Newz, Null, Nullav, Nullch, Nullcv, Nullfp, Nullgv, Nullhv, Nullsv, PL_dirty, PL_na.
  
  We actually (and arguably, wrongly) define PERL_CORE for an optimization in certain cases (but not when large files support is enabled, hence this doesn't happen often) and therefore don't get the definitions of these legacy symbols in that case. This commit fixes that, so that mod_perl can once again be built without large files support, but ideally our usage of PERL_CORE should be removed anyway.
........
  r1362409 | stevehay | 2012-07-17 10:43:28 +0200 (Tue, 17 Jul 2012) | 1 line
  
  Fix commit 1362399: PL_phase/PERL_PHASE_DESTRUCT is only available in newer perls, so restore use of PL_dirty for older perls (where it was always available, regardless of whether PERL_CORE was defined).
........
  r1362412 | stevehay | 2012-07-17 10:57:34 +0200 (Tue, 17 Jul 2012) | 1 line
  
  Update Changes file for commits 1362399 and 1362409.
........
  r1410264 | jorton | 2012-11-16 10:28:51 +0100 (Fri, 16 Nov 2012) | 4 lines
  
  * src/modules/perl/modperl_interp.c (modperl_interp_select): Fix for httpd 2.4.
  
  Submitted by: Jan Kaluza <jkaluza redhat.com>, jorton
........
  r1410291 | jorton | 2012-11-16 11:44:55 +0100 (Fri, 16 Nov 2012) | 6 lines
  
  * src/modules/perl/modperl_apache_compat.h: Fix definition of
    MP_HTTPD_OVERRIDE_OPTS_DEFAULT for 2.4.
  
  Obtained from: branches/httpd24
  Submitted by: torsten
........
  r1410293 | jorton | 2012-11-16 11:46:24 +0100 (Fri, 16 Nov 2012) | 2 lines
  
  * src/modules/perl/modperl_apache_compat.h: Fix version test.
........
  r1410295 | jorton | 2012-11-16 11:49:00 +0100 (Fri, 16 Nov 2012) | 4 lines
  
  * src/modules/perl/modperl_apache_includes.h: Use 2.4 logging API.
  
  Submitted by: Stefan Fritsch <sf sfritsch.de>, jorton
........
  r1410298 | jorton | 2012-11-16 11:52:40 +0100 (Fri, 16 Nov 2012) | 8 lines
  
  * src/modules/perl/modperl_apache_compat.h: Add mp_add_loaded_module
    wrapper function.
  
  * src/modules/perl/modperl_module.c (modperl_module_add): Use it.
  
  Obtained from: branches/httpd24
  Submitted by: torsten
........
  r1410299 | jorton | 2012-11-16 11:54:59 +0100 (Fri, 16 Nov 2012) | 2 lines
  
  Revert change accidentally included in r1410298.
........
  r1410314 | jorton | 2012-11-16 12:53:32 +0100 (Fri, 16 Nov 2012) | 4 lines
  
  Fix OPT_INCNOEXEC/OPT_INC_WITH_EXEC handling.
  
  Obtained from: branches/httpd24
........
  r1410316 | jorton | 2012-11-16 13:00:57 +0100 (Fri, 16 Nov 2012) | 5 lines
  
  * src/modules/perl/modperl_config.c (svav_getstr): Adjust for 2.4 API.
  
  Obtained from: branches/httpd24
  Submitted by: torsten
........
  r1410327 | jorton | 2012-11-16 14:06:50 +0100 (Fri, 16 Nov 2012) | 5 lines
  
  CScan gets rather confused if cpp's line number markers appear in the middle
  of a function declaration
  
  Submitted by: sf
........
  r1410329 | jorton | 2012-11-16 14:08:05 +0100 (Fri, 16 Nov 2012) | 4 lines
  
  Ignore more exports from 2.4/trunk which break "make source_scan".
  
  Submitted by: sf
........
  r1410343 | jorton | 2012-11-16 14:51:25 +0100 (Fri, 16 Nov 2012) | 5 lines
  
  * lib/Apache2/ParseSource.pm (include_dirs): Pick up APR include dir
    iff different to httpd include dir.
  
  Submitted by: Jan Kaluza <jkaluza redhat.com>, jorton
........
  r1410345 | jorton | 2012-11-16 15:04:59 +0100 (Fri, 16 Nov 2012) | 5 lines
  
  * src/modules/perl/modperl_apr_includes.h: Pick up new APR-util error
    codes.
  
  Submitted by: Jan Kaluza <jkaluza redhat.com>, jorton
........
  r1410400 | jorton | 2012-11-16 16:35:54 +0100 (Fri, 16 Nov 2012) | 6 lines
  
  * xs/Apache2/Log/Apache2__Log.h,
    src/modules/perl/modperl_apache_compat.h: Adapt logging for 2.4 API.
  
  Obtained from: branches/httpd24
  Submitted by: torsten
........
  r1410407 | jorton | 2012-11-16 16:44:08 +0100 (Fri, 16 Nov 2012) | 4 lines
  
  * lib/ModPerl/Code.pm: Add another constant for 2.4.
  
  Submitted by: sf
........
  r1410425 | jorton | 2012-11-16 17:09:40 +0100 (Fri, 16 Nov 2012) | 2 lines
  
  * lib/Apache2/ParseSource.pm: Pick up PROXYREQ_ constants.
........
  r1410427 | jorton | 2012-11-16 17:14:47 +0100 (Fri, 16 Nov 2012) | 5 lines
  
  Fix use of unixd_conifg for 2.4.
  
  Obtained from: branches/httpd24
  Submitted by: torsten
........
  r1419582 | jorton | 2012-12-10 18:01:24 +0100 (Mon, 10 Dec 2012) | 4 lines
  
  * lib/ModPerl/TypeMap.pm (typedefs_code, sv_convert_code):
    Produce output in sorted order for ease of diff across
    invocations.
........

........
* t/response/TestAPI/aplog.pm: adjust test to new error log format

Submitted by: sf

........
* xs/maps/modperl_types.map: Add U16 type to make 'make xs_generate' happy

Submitted by: sf

........
* lib/ModPerl/CScan.pm: Parse inline C functions in CScan
* lib/Apache2/ParseSource.pm: Return also inline functions in get_functions()


........
* xs/APR/APR/Makefile.PL: Link against aprutil-1. This is workaround
  for Apache2:Build issue.


........
* xs/APR/Socket/APR__Socket.h: Rename 'sock' to 'socket' to fix compilation


........
* lib/Apache2/ParseSource.pm: Do not CScan expat and byteswap headers, CScan
  cannot parse them


........
* t/conf/extra.conf.in: Set DefaultRuntimeDir


........
* xs/ModPerl/Const/Const.xs: Define perl_module to fix Const.so loading problem


........
* t/response/TestDirective/cmdparms.pm: Disable LimitExcept test, it can be used
  only in Directory with httpd-2.4


........
* xs/maps/apache2_functions.map: Add function for ServerRec::loglevel
* xs/Apache2/ServerUtil/Apache2__ServerUtil.h: port ServerRec::loglevel to
  httpd-2.4

........
Add new authz/authn API defined in httpd-2.4. It adds new directives
PerlAddAuthzProvider/PerlAddAuthnProvider to register providers and
RequestUtil::register_auth_provider method.

This commit is initial try to port this new API to mod_perl and it definitely
needs a review.


........
* t/response/TestAPI/access2.pm: Port the test to new authz/authn API introduced
  in httpd-2.4


........
* xs/Apache2/Access/Apache2__Access.h: return 'none' if RequestRec::auth_type
 is not set to stay compatible with older mod_perl.


........
* t/response/TestAPI/add_config.pm: AllowOverride can be used only in .htaccess,
  so disable it in add_config test


........
* t/response/TestAPI/aplog.pm: Set loglevel to LOG_DEBUG for tests which need it

........
* xs/maps/apache2_structures.map: Add new fields from httpd-2.4 structures

........
* t/response/TestAPI/conn_rec.pm: Use client_ip/client_addr instead of
  remote_ip/remote_addr.

........
* t/response/TestAPR/ipsubnet.pm: Use client_ip/client_addr instead of
  remote_ip/remote_addr.

........
* t/response/TestAPR/sockaddr.pm: Use client_ip/client_addr instead of
  remote_ip/remote_addr

........
* lib/Apache2/compat.pm: Use client_ip/client_addr instead of
  remote_ip/remote_addr

........
* t/hooks/TestHooks/authen_basic.pm: Do not check for ap_requires, it is
  not needed in httpd-2.4, because authz provider checks for the valid-user.


........
* t/hooks/TestHooks/authen_digest.pm: Set $r->user and $r->ap_auth_type,
  otherwise httpd-2.4 thinks that authentication was not done.

........
* t/hooks/TestHooks/authz.pm: Hardcode "dougm" username, because we don't
  have access to ap_requires in httpd-2.4. Another way could be to create
  new auth provider, but that's already tested in access2.t


........
* t/preconnection/TestPreConnection/note.pm: Use client_ip/client_addr instead
  of remote_ip/remote_addr

........
* t/response/TestModperl/setauth.pm: Return type of auth_type is 'none',
  not undef

........
* t/hooks/TestHooks/stacked_handlers2.pm: handler for PerlAuthenHandler has to
  set $r->user and $r->ap_auth_type, otherwise httpd will think that
  authentication was not done.

........
Result of 'make xs_generate' run.


........
* lib/Apache2/Build.pm: do not build with LFS

........
use APR::Finfo instead of Perls stat() in ModPerl::RegistryCooker
........
Fix t/perl/hash_attack.t to work with Perl 5.14.4, 5.16.3 etc, which contain a fix for CVE-2013-1667 (memory exhaustion with arbitrary hash keys). This resolves rt.perl.org #116863, from where the patch by Hugo van der Sanden was taken (with a minor edit in a comment by the committer).
Tested by the committer on Windows 7 x64 with VC++ 2010 using Perls 5.14.3, 5.14.4, 5.16.2 and 5.16.3-RC1, all against Apache 2.2.22.
........
On Perl 5.17.9, t/apache/read2.t fails because an "uninitialized value"
warning is generated for the buffer being autovivified. This is because
the sv_setpvn() that's meant to vivify the buffer doesn't perform set
magic; the warning is generated by the immediately following SvPV_force().
Patch to fix this from rt.cpan.org #83922. [Zefram]
........
Restore build with Perl 5.8.x (although 5.8.0 still has other problems for me).
- Recent perls set $Config{usethreads} to 'define' when built with ithreads, but older perls did not (-Dusethreads was different to -Duseithreads), causing a perl version check failure when wrongly testing $Config{usethreads} instead of the intended $Config{useithreads}.
- Newx and Newxz were added in 5.9.3.
........
Add Changes entry for revision 1457512.
........
On Perl 5.17.6 and above, hash seeding has changed, and HvREHASH has disappeared.
Patch to update mod_perl accordingly from rt.cpan.org #83921. [Zefram]
........
Perl 5.16.3's fix for a rehash-based DoS makes it more difficult to invoke the workaround for the old hash collision attack, which breaks mod_perl's t/perl/hash_attack.t. Patch from rt.cpan.org #83916 improves the fix previously applied as revision 1455340. [Zefram]
Tested by the committer on Windows 7 x64 using Perls 5.8.1, 5.8.2 (VC++ 6.0), 5.10.1, 5.12.5 (VC++ 2008), 5.14.2, 5.16.3, 5.17.5, 5.17.6 and 5.17.9 (VC++ 2010), all against Apache 2.2.22.
........
Clarify the supported Perl versions in the README as agreed on dev@perl.apache.org.
........
Adjustment to 'make tag' target from last release.

........
Releasing 2.0.8
........
Releasing 2.0.8
........
start 2.0.8-dev cycle
........
Notes from 2.0.8 release

........
Don't write an 'rpm' target into the Makefile on Windows. It isn't relevant on Windows, and the (hard-coded, not MakeMaker-generated) recipe group has syntax which dmake doesn't understand.

Using MinGW/+dmake to build mod_perl on Windows seems doomed to failure since that would require a MinGW build of Apache too, which is not well supported at best. However, this change means that any attempt to do so at least gets you down to the real problem (it starts compiling the first source file and falls over because a header file is missing), rather than choking on an invalid Makefile.

It also allows for building with VC+dmake (rather than its native nmake), which is an option supported by Perl and inherited by mod_perl via MakeMaker.
........
Fix the build with VC++ and dmake (rather than nmake) on Windows. The Makefile generated by Apache2::Build uses shell commands for the manifest file, but neglected to tell dmake to use the shell.
........
Re-enable test for local %ENV, now fixed.

Fixed-By-Revision: 357236
Reviewed-By: Gozer


........
Make sure authn and authz providers are cleaned up in time

The authn and authz providers need to be registered in the configuration
pool rather than the server process pool.  The latter outlives the load
time of the mod_perl shared object, so cleanup hooks could get called
after the registered functions were unloaded, causing SIGSEGVs and other
undefined behaviour.

Fix suggested by Stefan Fritsch.

Bug-Debian: http://bugs.debian.org/711213

........
Merged revisions 1451907,1455340,1456372,1457512,1457617-1457619,1458176,1460976,1469131,1469135,1469140,1470641,1477980,1477995,1491887 via svnmerge from 
https://svn.apache.org/repos/asf/perl/modperl/trunk

........
  r1451907 | torsten | 2013-03-02 18:20:05 +0100 (Sat, 02 Mar 2013) | 1 line
  
  use APR::Finfo instead of Perls stat() in ModPerl::RegistryCooker
........
  r1455340 | stevehay | 2013-03-11 22:38:15 +0100 (Mon, 11 Mar 2013) | 2 lines
  
  Fix t/perl/hash_attack.t to work with Perl 5.14.4, 5.16.3 etc, which contain a fix for CVE-2013-1667 (memory exhaustion with arbitrary hash keys). This resolves rt.perl.org #116863, from where the patch by Hugo van der Sanden was taken (with a minor edit in a comment by the committer).
  Tested by the committer on Windows 7 x64 with VC++ 2010 using Perls 5.14.3, 5.14.4, 5.16.2 and 5.16.3-RC1, all against Apache 2.2.22.
........
  r1456372 | stevehay | 2013-03-14 10:25:34 +0100 (Thu, 14 Mar 2013) | 5 lines
  
  On Perl 5.17.9, t/apache/read2.t fails because an "uninitialized value"
  warning is generated for the buffer being autovivified. This is because
  the sv_setpvn() that's meant to vivify the buffer doesn't perform set
  magic; the warning is generated by the immediately following SvPV_force().
  Patch to fix this from rt.cpan.org #83922. [Zefram]
........
  r1457512 | stevehay | 2013-03-17 19:48:50 +0100 (Sun, 17 Mar 2013) | 3 lines
  
  Restore build with Perl 5.8.x (although 5.8.0 still has other problems for me).
  - Recent perls set $Config{usethreads} to 'define' when built with ithreads, but older perls did not (-Dusethreads was different to -Duseithreads), causing a perl version check failure when wrongly testing $Config{usethreads} instead of the intended $Config{useithreads}.
  - Newx and Newxz were added in 5.9.3.
........
  r1457617 | stevehay | 2013-03-18 02:57:39 +0100 (Mon, 18 Mar 2013) | 1 line
  
  Add Changes entry for revision 1457512.
........
  r1457618 | stevehay | 2013-03-18 02:59:22 +0100 (Mon, 18 Mar 2013) | 2 lines
  
  On Perl 5.17.6 and above, hash seeding has changed, and HvREHASH has disappeared.
  Patch to update mod_perl accordingly from rt.cpan.org #83921. [Zefram]
........
  r1457619 | stevehay | 2013-03-18 03:07:50 +0100 (Mon, 18 Mar 2013) | 2 lines
  
  Perl 5.16.3's fix for a rehash-based DoS makes it more difficult to invoke the workaround for the old hash collision attack, which breaks mod_perl's t/perl/hash_attack.t. Patch from rt.cpan.org #83916 improves the fix previously applied as revision 1455340. [Zefram]
  Tested by the committer on Windows 7 x64 using Perls 5.8.1, 5.8.2 (VC++ 6.0), 5.10.1, 5.12.5 (VC++ 2008), 5.14.2, 5.16.3, 5.17.5, 5.17.6 and 5.17.9 (VC++ 2010), all against Apache 2.2.22.
........
  r1458176 | stevehay | 2013-03-19 09:30:53 +0100 (Tue, 19 Mar 2013) | 1 line
  
  Clarify the supported Perl versions in the README as agreed on dev@perl.apache.org.
........
  r1460976 | phred | 2013-03-26 06:09:39 +0100 (Tue, 26 Mar 2013) | 2 lines
  
  Adjustment to 'make tag' target from last release.
........
  r1469131 | phred | 2013-04-18 03:55:56 +0200 (Thu, 18 Apr 2013) | 1 line
  
  Releasing 2.0.8
........
  r1469135 | phred | 2013-04-18 03:59:45 +0200 (Thu, 18 Apr 2013) | 1 line
  
  Releasing 2.0.8
........
  r1469140 | phred | 2013-04-18 04:21:34 +0200 (Thu, 18 Apr 2013) | 1 line
  
  start 2.0.8-dev cycle
........
  r1470641 | phred | 2013-04-22 20:09:23 +0200 (Mon, 22 Apr 2013) | 2 lines
  
  Notes from 2.0.8 release
........
  r1477980 | stevehay | 2013-05-01 15:15:06 +0200 (Wed, 01 May 2013) | 5 lines
  
  Don't write an 'rpm' target into the Makefile on Windows. It isn't relevant on Windows, and the (hard-coded, not MakeMaker-generated) recipe group has syntax which dmake doesn't understand.
  
  Using MinGW/+dmake to build mod_perl on Windows seems doomed to failure since that would require a MinGW build of Apache too, which is not well supported at best. However, this change means that any attempt to do so at least gets you down to the real problem (it starts compiling the first source file and falls over because a header file is missing), rather than choking on an invalid Makefile.
  
  It also allows for building with VC+dmake (rather than its native nmake), which is an option supported by Perl and inherited by mod_perl via MakeMaker.
........
  r1477995 | stevehay | 2013-05-01 15:33:36 +0200 (Wed, 01 May 2013) | 1 line
  
  Fix the build with VC++ and dmake (rather than nmake) on Windows. The Makefile generated by Apache2::Build uses shell commands for the manifest file, but neglected to tell dmake to use the shell.
........
  r1491887 | gozer | 2013-06-11 19:50:57 +0200 (Tue, 11 Jun 2013) | 6 lines
  
  Re-enable test for local %ENV, now fixed.
  
  Fixed-By-Revision: 357236
  Reviewed-By: Gozer
........

........
Set explicit DefaultRuntimeDir to not use the preconfigured one
which may be unwritable during tests.

Submitted by: Niko Tyni <ntyni debian.org>

........
Save results of xs_generate to xs/tables/current24 when buildign with httpd-2.4.

This allows having generated xs wrapping for both httpd-2.4 and httpd-2.2
versions.

........
Move xs/tables generated with httpd-2.4 into "current24" directory and revert
old "current" directory to xs/tables generated with httpd-2.2.

........
Compile new authz/authn API only with httpd-2.4.

........
Port server_rec::loglevel to perl only when compiling with httpd-2.4

........
Split t/response/TestAPI/access2.pm to httpd-2.4 and httpd-2.2 parts.

........
Split also t/api/access2.t for httpd-2.4 and httpd-2.2

........
Fix aplog test with httpd-2.2

........
Fix conn_rec test with httpd-2.2

........
Stay compatible with httpd-2.2 in Apache2::compat

........
Wrap server_rec::is_virtual as int (not as char)

........
Use conditionals in xs/maps to not use httpd-2.4 api with httpd-2.2

........
Use Apache-Test from trunk - revision 1495998
........
Move all declarations before code: VC++ doesn't support code before declarations unless compiling as C++.
........
Don't use AP_DECLARE when declaring/defining our own versions of functions no longer in httpd

The AP_DECLARE macro marks symbols as "dllexport" when compiled in httpd or as "dllimport" when compiled in third-party code such as mod_perl, but defining a function marked "dllimport" isn't allowed.
........
Fix linking of libaprext.lib on Windows

When building against httpd-2.4+ modprel_apache_compat.h references the "extern" symbol 'perl_module' so we must provide a definition to satisfy the linker. Including the usual definition in mod_perl.c is not possible here, so just use a dummy definition instead since the symbol is not really used anyway.
........
Move all declarations before code: VC++ doesn't support code before declarations unless compiling as C++.
........
Fix the problem of "-laprutil-1" not being found when running xs/APR/APR/Makefile.PL on Windows

The Apache2::Build module provides apache_libs() which locates this library (and others, which the linker will quietly ignore if not required) for Windows and Cygwin so use that, inspired by what is done in ModPerl::BuildMM::WriteMakefile().

Perhaps implementing apache_libs() on other OSes would resolve the FIXME regarding other OSes in xs/APR/APR/Makefile.PL?
........
Fix a linker error when building Apache2::Provider

The symbol ap_register_provider was not being found even though it is exported from libhttpd.lib, which was being linked against. The problem was that no declaration of it had been seen since httpd's ap_provider.h was not being included.
........
Fix linker error when building Apache2::ServerUtil

The symbol ap_get_server_version was not being found because as noted in ap_mmn.h that function was replaced by ap_get_server_banner and ap_get_server_description in httpd-2.3, so make the necessary change in apache2_functions.map to reflect that.
........
Correction to r1503136.

The httpd header file ap_provider.h is not in httpd-2.2, as pointed out by Jan Kaluza.
........
Use 'const char *' instead of 'char *' in modperl_util.c, do not try to get
interp_pool in perl_parse_require_line if we don't have the proper key for 
this require line in global_authz_providers.

........
Return NULL in modperl_interp_pool_select in case scfg->mip is not defined.
Handle that situation in modperl_util.

........
Restore the early return in perl_parse_require_line() if the key is not found (as per 1503171),
and only call modperl_interp_pool_select() if USE_ITHREADS is #defined.
........
Fix linking of Apache2::ServerUtil

This commit reverts r1503137: I had failed to spot that ap_get_server_version is actually defined in modperl_apache_compat.c (thanks, Jan Kaluza!), which I should have known because I'd already fiddled with it in r1502135! This commit also reverts that, and (hopefully) does the job properly this time.

Normally, ap_get_server_version is exported from an httpd library and AP_DECLARE in third-party code such as ours means to dllimport it from there. However, if we're building against httpd-2.3+ then httpd no longer provides that symbol, but we have our own definition in modperl_apache_compat.c instead. In this case we need AP_DECLARE to mean dllexport (like it does when building the httpd core) so that our compat version gets exported from mod_perl.so/lib (but we still need to dllimport it when building Apache2/ServerUtil/ServerUtil.dll, of course).

This is effected by #defining AP_DECLARE_EXPORT in modperl_apache_compat.c (before modperl_apache_compat.h gets included, to cover the declaration too). This will affect all such declarations in that file (which is correct, being the whole point of the file) without affecting any other code, which continues to dllimport as usual (either from some httpd library, or from mod_perl.so/lib, whatever happens to provide the definition).

The case of ap_get_server_banner/description must also have been similarly broken for httpd-2.2 builds, and should also be fixed by this commit.
........
Skip access2.t/access2_24.t in case we build with httpd-2.4/httpd-2.2
........
Wrap <IfVersion>s added by r1497234 in <IfModule mod_version.c> as per r1504090.
........
There is no need to define a dummy perl_module symbol in ModPerl/Const/Const.xs on Windows

All DLLs except for the APR ones are linked against mod_perl.lib anyway (see ModPerl::BuildMM::WriteMakefile())
so they have the real definition of perl_module already.
........
Use Apache-Test revision 1504090
........
Link against APR generation 1 still with httpd-2.4

Httpd-2.4 is still intended to be compiled with APR-1.x, so this reverts rev. 1222775 (on the trunk) and hence also revs. 1448043 & 1503135 (on this branch) which both worked around breakages caused by that premature switch to APR generation 2.
........
Add the path to mod_perl.so to the PATH when running the test suite on Windows

Httpd.exe is able to find mod_perl.so because the test httpd.conf contains a LoadModule line with the fully qualified path to mod_perl.so in it. However, before httpd.exe is started the test framework must create that httpd.conf file. In the case of mod_perl it uses perl.exe and goes into Apache/TestConfigPerl.pm's run_apache_test_configure(), which runs APACHE_TEST_CONFIGURE() in various modules in t/response/TestApache (e.g. subprocess.pm). Those modules all use Apache2::Const, but Apache2/Const/Const.dll and ModPerl/Const/Const.dll now depend on mod_perl.so for the 'perl_module' symbol. Therefore, perl.exe must be able to find mod_perl.so when running the tests, and this is the easiest way to achieve that.

There is no problem with Apache2::Const and ModPerl::Const depending on mod_perl.so because they are normally only used within a mod_perl application, which will (obviously) have mod_perl.so loaded already. (It is only the APR::* modules which we are at pains (elsewhere) to avoid having a dependency on mod_perl.so because they are of use outside of mod_perl applications.)
........
Fix t/api/err_headers_out.t with HTTP::Headers > 6.00. Patch from Rolando <rolosworld@gmail.com>.
........
Fix t/compat/apache_file.t on Windows.
........
Merged revision(s) 1528836-1528881 from perl/modperl/trunk:
Fix t/api/err_headers_out.t with HTTP::Headers > 6.00. Patch from Rolando <rolosworld@gmail.com>.
........
Fix t/compat/apache_file.t on Windows.
........

........
Create branch from the httpd24 branch to attempt merging the threading branch into.
........
Merged revision(s) 584377 from perl/modperl/branches/threading:
Introduce ModPerl::Interpreter, an interface to modperl_interp_t.
Note, this currently does not behave correctly with a non-threaded
Apache

Submitted-By Torsten Foertsch <torsten.foertsch@gmx.net>
Message-Id: <200710101543.33946.torsten.foertsch@gmx.net>
Reviewed-By: gozer

........

........
Merged revision(s) 594345 from perl/modperl/branches/threading:
Cleanup modperl_trace() a little by always prefixing trace
messages with the current pid/tid and always adding a newline.

Simplifies things a little, and modperl_pid_tid() goes
away.

Reviewed-By: gozer
Submitted-By: Torsten Foertsch <torsten.foertsch@gmx.net>
Message-Id: <200710221220.17860.torsten.foertsch@gmx.net>


........

........
Merged revision(s) 594347 from perl/modperl/branches/threading:
Expose modperl_interp_pool_t via ModPerl::InterpPool, modperl_tipool_t
via ModPerl::TiPool and modperl_tipool_config_t via ModPerl::TiPoolConfig

Reviewed-By: Gozer
Submitted-By: Torsten Foertsch <torsten.foertsch@gmx.net>
Message-Id: <200710242028.07750.torsten.foertsch@gmx.net>


........

........
Merged revision(s) 594601 from perl/modperl/branches/threading:
For threaded MPMs, change interpreter managment to a new, reference-counted
allocation model.

Reviewed-by: gozer
Submitted-By: Torsten Foertsch <torsten.foertsch@gmx.net>
Message-Id: <200710232035.27943.torsten.foertsch@gmx.net>


........

........
Merged revision(s) 594609 from perl/modperl/branches/threading:
Now correctly invokes PerlCleanupHandlers, even if they are the only 
handler type configured for that request

Reviewed-By: gozer
Submitted-By: Torsten Foertsch <torsten.foertsch@gmx.net>
Message-Id: <200710241325.53933.torsten.foertsch@gmx.net>


........

........
Merged revision(s) 594612-607681 from perl/modperl/branches/threading:
This one makes PerlInterpScope more advisory. Using pnotes increment the 
refcnt of the interp thus binding it to the lifetime of the pnotes. So, using 
$c->pnotes binds the interp to the lifetime of the connection, $r->pnotes to 
the request lifetime.

$[rc]->pnotes_kill() can be used to prematurely drop pnotes and thus remove 
the binding.

Reviewed-By: gozer
Submittted-By: Torsten Foertsch <torsten.foertsch@gmx.net>
Message-Id: <200710241945.25803.torsten.foertsch@gmx.net>


........
Forgot to add the test case for a previous fix.

Reviewed-By: gozer
Submitted-By: Torsten Foertsch <torsten.foertsch@gmx.net>
Message-Id: <200705101104.48324.torsten.foertsch@gmx.net>


........

........
Merged revision(s) 671869 from perl/modperl/branches/threading:
delete emacs local variables
........

........
Merged revision(s) 671871 from perl/modperl/branches/threading:
cleaning up trailing spaces and expanding tabs where necessary
........

........
Merged revision(s) 671879 from perl/modperl/branches/threading:
add emacs Location Variables at the end of all .c and .h files

........

........
Merged revision(s) 671881 from perl/modperl/branches/threading:
expand tabs in C files
........

........
Merged revision(s) 671901 from perl/modperl/branches/threading:
expanding tabs in Perl files
........

........
Merged revision(s) 671910-671912 from perl/modperl/branches/threading:
add emacs local vars to Perl files. This is done by adding
a "-*- mode: ..." line either as the second line after shebang (#!...)
or as the first line.

This way the __DATA__ section is untouched.

........
add emacs local vars to Perl files in t/.../*.t. This is done by adding
a "-*- mode: ..." line either as the second line after shebang (#!...)
or as the first line.

This way the __DATA__ section is untouched.


........

........
Merged revision(s) 671923 from perl/modperl/branches/threading:
more whitespace cleanups
........

........
Merged revision(s) 671924 from perl/modperl/branches/threading:
add emacs mode line (-*-) to ModPerl-Registry/t/*
........

........
Merged revision(s) 672234 from perl/modperl/branches/threading:
remove trailing \n from MP_TRACE output because modperl_trace appends a \n by itself
........

........
Merged revision(s) 672339 from perl/modperl/branches/threading:
change "XSLoader::load(@_)" to "goto &XSLoader::load" in {Apache,APR}::XSLoader
........

........
Merged revision(s) 672737-672745 from perl/modperl/branches/threading:
silence a few unused warnings
........
allow for other suffixes than "-dev" or "-rc\d+" in our VERSION_STRING
........
reordered Changes: 2.0.5-threading1 item at the first place
........
remove the "-" from our VERSION_STRING to make it compatible with RPM versions
........

........
Merged revision(s) 933550, 940297, 940303 from perl/modperl/branches/threading:
t/directive/perlcleanuphandler.t needs LWP to perform keep-alive requests
........
now it compiles and tests with a non-threaded perl
........
silence a warning (useless storage class specifier in empty declaration)
........

........
Merged revision(s) 1075807, 1241583, 1241983-1241984, 1241987, 1242010, 1242050, 1242068 from perl/modperl/branches/threading:
reintroduce MP_dTHX macro
........
modperl_interp_pool_select() when used to create or merge dir-configs
at runtime may pull the interpreter from the wrong pool if the request's
server is a vhost with a separate interpreter pool.

........
improve MP_TRACE output a bit: include current perl context for
threaded perls

........
rename assert() => ap_assert()
........
similar to r1241583: make sure r->server is used to identify the interpreter
pool to pull from at runtime.

........
comment added
........
remove a bit of code complexity

modperl_module.c contains these 2 lines:

	interp = modperl_interp_pool_select(p, s);
	MP_PERL_CONTEXT_STORE_OVERRIDE(interp->perl);

The latter decodes as

	orig_perl = PERL_GET_CONTEXT;
	aTHX = interp->perl;
	PERL_SET_CONTEXT(aTHX);

Now, modperl_interp_pool_select() already calls PERL_SET_CONTEXT with the
newly allocated interpreter. So, we get

	PERL_SET_CONTEXT(interp->perl);
	orig_perl = PERL_GET_CONTEXT;
	aTHX = interp->perl;
	PERL_SET_CONTEXT(aTHX);

But this is the same as

	interp = modperl_interp_pool_select(p, s);
	aTHX = interp->perl;

........
ap_assert => MP_ASSERT (depends on MP_DEBUG)
........

........
Merged revision(s) 1242858 from perl/modperl/branches/threading:
- introduce a few preprocessor macros aiming at a more robust interpreter
  handling (not finished yet).
- deleting some cruft from ancient perl versions.


........

........
Merged revision(s) 1243509 from perl/modperl/branches/threading:
Improve interpreter management

The goal of this change is to detect earlier cases when a perl interpreter
may be used by multiple threads simultaneously. This is done partly by
wrapping the interpreter allocation functions into preprocessor macros
to provide consistent trace messages and more important to reset aTHX to
NULL when the interpreter is put back.

Currently interpreter are pulled from the pool and set as context via
PERL_SET_CONTEXT. But when an interpreter is put back to the pool the
context is not reset to NULL. In an ideal world this should not be
necessary because the interpreter will not be used again. But for
debugging it's quite useful to put NULL in the perl context upon
putting back the interpreter. Thus, the program will segfault if the
thread wants to use an interpreter that already has been declared as
free.

That way a few errors where found and hopefully fixed:
  * modperl_filter_f_cleanup() frees the perl-level filter context but was
    called after the interpreter has already been put back.
  * similar situation in request time config MERGE operations. They also
    register a cleanup handler that uses the  perl interpreter. But they
    do not make sure that the interpreter is bound to the request at least
    up to the time the cleanup is invoked.

Currently available macros include:
  * MP_dINTERP
    declares the variables aTHX (my_perl) and interp

  * MP_INTERPa(r, c, s)
    selects an interpreter via modperl_interp_select and assigns aTHX and
    interp

  * MP_dINTERPa(r, c, s)
    combination of MP_dINTERP and MP_INTERPa

  * MP_INTERP_POOLa(p, s)
    like MP_INTERPa but calls modperl_interp_pool_select

  * MP_dINTERP_POOLa(p, s)
    combination of MP_dINTERP and MP_INTERP_POOLa    

  * MP_INTERP_PUTBACK(interp, thx)
    puts the interpreter back via modperl_interp_unselect and assigns NULL
    to aTHX

  * MP_INTERP_REFCNT_inc(interp)
    increments interp->refcnt

  * MP_INTERP_REFCNT_dec(interp)
    alias for MP_INTERP_PUTBACK(interp, NULL)

  * MP_ASSERT_CONTEXT(thx)
    checks for PERL_GET_CONTEXT==thx

The same set of macros/functions is now also used for pre-runtime stuff.
However, this part is not yet finished.

........

........
Merged revision(s) 1243554, 1243647, 1243679, 1245916, 1291304 from perl/modperl/branches/threading:
move interp allocation out of modperl_hash_handlers*()

These functions are called in a loop (modperl_mgv_hash_handlers()). Now,
the interp is allocated outside the loop.

........
drop unused MP_dTHX and MP_uTHX macros
........
eliminate MP_dSCFG_dTHX
........
suppress "perl=..." output in MP_TRACE output before the first interpreter has been started
........
fix missing base_scfg declaration in modperl_init() if USE_ITHREADS && !MP_TRACE
........

........
Corrections to mistakes that I made in the course of merging everything from threading that wasn't already in httpd24 into this httpd24threading branch. I hope I have it correct now, but it wasn't an easy merge and there may still be mistakes. These all came to light in the course of building the new branch. More may come to light when I actually get it running.
........
Hack to restore the build of APR::* modules. The httpd24threading branch now builds for me on Windows/VS2010 against httpd-2.4.4/perl-5.19.4 (default debugging mode build configurations).
........
Revision 1538006 did this for 2.4, but should have done likewise for 2.2 too.
........
Revision 1538005 (which is what the previous revision should have cited too!) did this in modperl_util.c but missed this file.
........
Make MP_INTERPa and MP_INTERP_POOLa more robust in the event of modperl_interp_select() returning NULL.
........
Save the test suite from crashing httpd.exe on start-up:
- Use the correct pool in MP_dINTERP_POOLa.
- Delay the use of MP_dINTERP_POOLa until it's really needed. We don't seem to have an interpreter available at this time, but it so happens that the test suite doesn't exercise going this far through perl_parse_require_line() anyway, so this bypasses the crash for now.
- Add an early return with trace diagnostic when MP_dINTERP_POOLa returns NULL to continue bypassing the crash if the test suite is enhanced to exercise more of perl_parse_require_line(). The trace diagnostic will help alert us to the fact that the order of creating an interpreter vs. handling Require parsing is still unresolved.

Many thanks to Jeff Trawick++ for invaluable assistance in getting this far.
........
Provide a better return value from perl_parse_require_line() in the case where interp is NULL and add a comment to explain why we currently don't expect this to happen.

Thanks again to Jeff Trawick for this.
........
Restructure perl_get_realm_hash() as per perl_parse_require_line() in r1539414/1539487, fixing the test for ab->cb2 and correcting the early return values (we should probably return AUTH_USER_NOT_FOUND in the case that ab->cb2 is NULL since that's currently expected behaviour, but we think AUTH_GENERAL_ERROR is wiser for now so as not to let on that we have a realm hash function; the latter is also correct in the unexpected case that ab is NULL, and will also be correct for the case that ab->cb2 is NULL in the future if PerlAddAuthnProvider ever supports an optional second handler).

Thanks to Jan Kaluža and Jeff Trawick for advice with this.
........
Change http://perl.apache.org/dist/ to http://apache.org/dist/perl/ in a couple of places.

*** The top-level RELEASE file needs a major overhaul in this regard too, but I will leave that until the next release is made so that the changes can be tried out at the same time. ***
........
Mark interpreter as "free" when the refcnt decrements to 0. This fixes freezing
tests with event MPM (and concurrent requests with event MPM).

........
The extended printf format %pt in apr_vformatter() requires a apr_os_thread_t*, not a (void*)apr_os_thread_t. This fixes a crash in conv_os_thread_t when starting up httpd+mod_perl on Windows with "PerlTrace all" set
........
Correct perl version check in APR::PerlIO::PERLIO_LAYERS_ARE_ENABLED().
Sadly this was not the cause of t/apache/subprocess.t failing on Windows with httpd-2.4.x.
........
Remove unused constant PERLIO_5_8_IS_ENABLED from subprocess.pm.
........
Fix t/apache/subprocess.t on Windows, using httpd-2.4.x.

This test fails every time for me, but not with httpd-2.2.x, which I don't understand. Debugging, if you start up the server, then add a break point in APR's read_with_timeout() (in readwrite.c) and walk through the function each time it is hit then the test passes. Without debugging it puts a "APR::PerlIO::read: (70007) The timeout specified has expired" error in the error_log and fails all tests.

Presumably it is trying to read from the process spawned in subprocess.pm before the pipe is ready to be read from, and the delay in manually debugging fixes that. The comments in read_data() in subprocess.pm note that a delay is indeed required, and is achieved by select() in the non-PerlIO case (which I imagine nobody uses now anyway) or a apr_wait_for_io_or_timeout() call from apr_file_read() in the PerlIO case.

However, whilst that remark is true of the *nix implementation of apr_file_read() (in file_io/unix/readwrite.c), it is not true of the Win32 version (in file_io/win32/readwrite.c).

Thus, adding a short sleep() fixes it on Win32. What I don't understand is why this wasn't necessary with httpd-2.2.x. The file_io/win32/readwrite.c file is identical in the two versions I'm using (httpd-2.4.6 vs httpd-2.2.25; apr-1.4.8 in both).
........
Fix t/directive/perlloadmodule2.t

The third test (for $url/subdir) was failing because the absence of an argument ($url?...) caused a warning that $r->arg was undefined in perlloadmodule2.pm, and the "use warnings FATAL => 'all';" line saw to it that the server returned 500/Internal Server Error in this case.
........
Fix t/modperl/interpreter.t

ModPerl::Interpreter was added to the threading branch by r584377 and r594347 but when I merged those with the httpd24 branch into the httpd24threading branch the merge only went into xs/tables/current; I missed adding them to the new xs/tables/current24 too.

Note: This is a manual update of the xs/tables, just like the original commits on the threading branch appear to have been too judging by the fact that the timestamps at the tops of those files were not updated. I have not run "perl build/source_scan.pl" since it doesn't seem to run properly here on Windows, even after setting $Config{cppstdin}.
........
Fix received/expected order in echo_timeout.t.
This test currently fails on Windows with httpd-2.4.6, receiving nothing when "good bye cruel world" was expected.
........
Require threaded Perl when compilling with httpd >= 2.4.0. Remove unused option
MP_NONTHREADED_OK and replace it with MP_NO_THREADS.

This is follow up of r1151822.

........
Fix compilation with MP_NO_THREADS=1 by using MP_HAS_INTERP in conditions
checking for "interp".

........
Revert revision 1491887 so that modperl/local_env.t is skipped once again.

It evidently still isn't fixed :-( ... On Windows, with the test enabled it not only fails test 6, but also causes the following to fail (using either httpd-2.2.26 or httpd-2.4.7):

modperl/merge.t: 3, 6, 9
modperl/merge2.t: 3, 6, 9
modperl/merge3.t: 3, 6, 9
modules/cgi.t: 1-5
modules/cgi2.t: 1-5
modules/cgipost.t: 2-6
modules/cgipost2.t: 2-6
modules/cgiupload.t: 1-2
modules/cgiupload2.t: 1-2

It also causes the same failures (actually just 1-4 for cgi.t and cgi2.t) in trunk, tested with httpd-2.2.26. Moreover, the breakage isn't limited to Windows either: it also causes the following to fail on Fedora 20 (using either httpd-2.2.23 or httpd-2.4.9):

modules/cgi.t: 2, 5
modules/cgi2.t: 3
modules/cgipost.t: 4
modules/cgipost2.t: 4
modules/cgiupload.t: 1
modules/cgiupload2.t: 2

and again also in trunk (with httpd-2.2.23).
........
Merge the only thing on trunk that isn't already in httpd24threading into httpd24threading ahead of merging everything back to trunk. This is purely for the sake of my sanity...
........
Merged revision(s) 1537484 from perl/modperl/branches/httpd24threading:
Merged revision(s) 584377 from perl/modperl/branches/threading:
Introduce ModPerl::Interpreter, an interface to modperl_interp_t.
Note, this currently does not behave correctly with a non-threaded
Apache

Submitted-By Torsten Foertsch <torsten.foertsch@gmx.net>
Message-Id: <200710101543.33946.torsten.foertsch@gmx.net>
Reviewed-By: gozer

........

........

........
Merged revision(s) 1537492 from perl/modperl/branches/httpd24threading:
Merged revision(s) 594345 from perl/modperl/branches/threading:
Cleanup modperl_trace() a little by always prefixing trace
messages with the current pid/tid and always adding a newline.

Simplifies things a little, and modperl_pid_tid() goes
away.

Reviewed-By: gozer
Submitted-By: Torsten Foertsch <torsten.foertsch@gmx.net>
Message-Id: <200710221220.17860.torsten.foertsch@gmx.net>


........

........

........
Merged revision(s) 1537493 from perl/modperl/branches/httpd24threading:
Merged revision(s) 594347 from perl/modperl/branches/threading:
Expose modperl_interp_pool_t via ModPerl::InterpPool, modperl_tipool_t
via ModPerl::TiPool and modperl_tipool_config_t via ModPerl::TiPoolConfig

Reviewed-By: Gozer
Submitted-By: Torsten Foertsch <torsten.foertsch@gmx.net>
Message-Id: <200710242028.07750.torsten.foertsch@gmx.net>


........

........

........
[Oops. Merging from httpd24threading back to trunk isn't going to work yet. The branches httpd24 and threading were both copied from trunk. The threading branch was then merged into httpd24threading, which was copied from httpd24 so all of the threading branch's changes will find their way back to trunk when httpd24threading is merged back, but the changes on httpd24 prior to httpd24threading being copied from it have been missed: there are no *revisions* on httpd24threading containing those changes, so httpd24 needs merging back to trunk first, and only then can we merge httpd24threading back to trunk...]

Reverse merged revision(s) 1602085, 1602083-1602082 from perl/modperl/trunk:
Merged revision(s) 1537493 from perl/modperl/branches/httpd24threading:
Merged revision(s) 594347 from perl/modperl/branches/threading:
Expose modperl_interp_pool_t via ModPerl::InterpPool, modperl_tipool_t
via ModPerl::TiPool and modperl_tipool_config_t via ModPerl::TiPoolConfig

Reviewed-By: Gozer
Submitted-By: Torsten Foertsch <torsten.foertsch@gmx.net>
Message-Id: <200710242028.07750.torsten.foertsch@gmx.net>


........

........

........
Merged revision(s) 1537484 from perl/modperl/branches/httpd24threading:
Merged revision(s) 584377 from perl/modperl/branches/threading:
Introduce ModPerl::Interpreter, an interface to modperl_interp_t.
Note, this currently does not behave correctly with a non-threaded
Apache

Submitted-By Torsten Foertsch <torsten.foertsch@gmx.net>
Message-Id: <200710101543.33946.torsten.foertsch@gmx.net>
Reviewed-By: gozer

........

........

........
Merged revision(s) 1537492 from perl/modperl/branches/httpd24threading:
Merged revision(s) 594345 from perl/modperl/branches/threading:
Cleanup modperl_trace() a little by always prefixing trace
messages with the current pid/tid and always adding a newline.

Simplifies things a little, and modperl_pid_tid() goes
away.

Reviewed-By: gozer
Submitted-By: Torsten Foertsch <torsten.foertsch@gmx.net>
Message-Id: <200710221220.17860.torsten.foertsch@gmx.net>


........

........

........

........
[Merge only "recorded", i.e. blocked from merge. This was the only change on trunk not in httpd24, and will hopefully now allow a reintegrate/automatic merge to go ahead.]

Merged revision(s) 1151791 from perl/modperl/trunk:
Initialized merge tracking via "svnmerge" with revisions "1-1151159" from 
https://svn.eu.apache.org/repos/asf/perl/modperl/branches/httpd24

........

........


git-svn-id: https://svn.apache.org/repos/asf/perl/modperl/trunk@1602105 13f79535-47bb-0310-9956-ffa450edef68