Author: torsten
Date: Thu Jul 28 12:53:35 2011
New Revision: 1151827
URL: http://svn.apache.org/viewvc?rev=1151827&view=rev
Log:
make modperl compilable with httpd 2.3.14.
Added:
perl/modperl/branches/httpd24/xs/Apache2/ServerRec/Apache2__ServerRec.h
Modified:
perl/modperl/branches/httpd24/lib/ModPerl/Code.pm
perl/modperl/branches/httpd24/src/modules/perl/mod_perl.c
perl/modperl/branches/httpd24/src/modules/perl/modperl_apache_compat.h
perl/modperl/branches/httpd24/src/modules/perl/modperl_cmd.h
perl/modperl/branches/httpd24/src/modules/perl/modperl_config.c
perl/modperl/branches/httpd24/src/modules/perl/modperl_module.c
perl/modperl/branches/httpd24/src/modules/perl/modperl_pcw.c
perl/modperl/branches/httpd24/t/response/TestAPI/add_config.pm
perl/modperl/branches/httpd24/xs/Apache2/Access/Apache2__Access.h
perl/modperl/branches/httpd24/xs/Apache2/Log/Apache2__Log.h
perl/modperl/branches/httpd24/xs/Apache2/ServerUtil/Apache2__ServerUtil.h
perl/modperl/branches/httpd24/xs/maps/apache2_functions.map
perl/modperl/branches/httpd24/xs/tables/current/Apache2/ConstantsTable.pm
Modified: perl/modperl/branches/httpd24/lib/ModPerl/Code.pm
URL:
http://svn.apache.org/viewvc/perl/modperl/branches/httpd24/lib/ModPerl/Code.pm?rev=1151827&r1=1151826&r2=1151827&view=diff
==============================================================================
--- perl/modperl/branches/httpd24/lib/ModPerl/Code.pm (original)
+++ perl/modperl/branches/httpd24/lib/ModPerl/Code.pm Thu Jul 28 12:53:35 2011
@@ -825,7 +825,8 @@ my %ifdef = map { $_, 1 }
qw(AP_MPMQ_STARTING AP_MPMQ_RUNNING AP_MPMQ_STOPPING
AP_MPMQ_MPM_STATE), # added in 2.0.49
qw(APR_FPROT_USETID APR_FPROT_GSETID
- APR_FPROT_WSTICKY APR_FOPEN_LARGEFILE); # added in 2.0.50?
+ APR_FPROT_WSTICKY APR_FOPEN_LARGEFILE), # added in 2.0.50?
+ qw(OPT_INCNOEXEC OPT_INC_WITH_EXEC);
sub constants_ifdef {
my $name = shift;
Modified: perl/modperl/branches/httpd24/src/modules/perl/mod_perl.c
URL:
http://svn.apache.org/viewvc/perl/modperl/branches/httpd24/src/modules/perl/mod_perl.c?rev=1151827&r1=1151826&r2=1151827&view=diff
==============================================================================
--- perl/modperl/branches/httpd24/src/modules/perl/mod_perl.c (original)
+++ perl/modperl/branches/httpd24/src/modules/perl/mod_perl.c Thu Jul 28
12:53:35 2011
@@ -653,6 +653,10 @@ int modperl_is_running(void)
int modperl_hook_pre_config(apr_pool_t *p, apr_pool_t *plog,
apr_pool_t *ptemp)
{
+#if AP_MODULE_MAGIC_AT_LEAST(20110329,0)
+ ap_reserve_module_slots_directive("PerlLoadModule");
+#endif
+
/* we can't have PerlPreConfigHandler without first configuring mod_perl */
/* perl 5.8.1+ */
Modified: perl/modperl/branches/httpd24/src/modules/perl/modperl_apache_compat.h
URL:
http://svn.apache.org/viewvc/perl/modperl/branches/httpd24/src/modules/perl/modperl_apache_compat.h?rev=1151827&r1=1151826&r2=1151827&view=diff
==============================================================================
--- perl/modperl/branches/httpd24/src/modules/perl/modperl_apache_compat.h
(original)
+++ perl/modperl/branches/httpd24/src/modules/perl/modperl_apache_compat.h Thu
Jul 28 12:53:35 2011
@@ -66,12 +66,40 @@ AP_DECLARE(const char *) ap_get_server_v
#define MP_HTTPD_OVERRIDE_HTACCESS
(OR_LIMIT|OR_OPTIONS|OR_FILEINFO|OR_AUTHCFG|OR_INDEXES)
#define MP_HTTPD_OVERRIDE_OPTS_UNSET (-1)
+
+#if AP_SERVER_MAJORVERSION_NUMBER>2 || AP_SERVER_MINORVERSION_NUMBER>=3
+/* 2.4 API */
+
+#define mp_add_loaded_module(modp, pool, name) \
+ ap_add_loaded_module((modp), (pool), (name))
+
+#define mp_loglevel(s) ((s)->log.level)
+#define mp_module_index_ perl_module.module_index,
+
+#define MP_HTTPD_OVERRIDE_OPTS_DEFAULT (OPT_UNSET | \
+ OPT_ALL | \
+ OPT_SYM_OWNER | \
+ OPT_MULTI)
+
+#else
+/* 2.2 API */
+
+#define mp_add_loaded_module(modp, pool, name) \
+ ap_add_loaded_module((modp), (pool))
+
+#define mp_loglevel(s) ((s)->loglevel)
+#define mp_module_index_
+
#define MP_HTTPD_OVERRIDE_OPTS_DEFAULT (OPT_UNSET | \
OPT_ALL | \
OPT_INCNOEXEC | \
OPT_SYM_OWNER | \
OPT_MULTI)
+#define ap_unixd_config unixd_config
+
+#endif
+
#ifndef PROXYREQ_RESPONSE
#define PROXYREQ_RESPONSE (3)
#endif
Modified: perl/modperl/branches/httpd24/src/modules/perl/modperl_cmd.h
URL:
http://svn.apache.org/viewvc/perl/modperl/branches/httpd24/src/modules/perl/modperl_cmd.h?rev=1151827&r1=1151826&r2=1151827&view=diff
==============================================================================
--- perl/modperl/branches/httpd24/src/modules/perl/modperl_cmd.h (original)
+++ perl/modperl/branches/httpd24/src/modules/perl/modperl_cmd.h Thu Jul 28
12:53:35 2011
@@ -115,6 +115,10 @@ MP_CMD_SRV_DECLARE(interp_scope);
AP_INIT_ITERATE( name, modperl_cmd_##item, NULL, \
RSRC_CONF, desc )
+#define MP_CMD_SRV_ITERATE_ON_READ(name, item, desc) \
+ AP_INIT_ITERATE( name, modperl_cmd_##item, NULL, \
+ RSRC_CONF|EXEC_ON_READ, desc )
+
#define MP_CMD_SRV_ITERATE2(name, item, desc) \
AP_INIT_ITERATE2( name, modperl_cmd_##item, NULL, \
RSRC_CONF, desc )
Modified: perl/modperl/branches/httpd24/src/modules/perl/modperl_config.c
URL:
http://svn.apache.org/viewvc/perl/modperl/branches/httpd24/src/modules/perl/modperl_config.c?rev=1151827&r1=1151826&r2=1151827&view=diff
==============================================================================
--- perl/modperl/branches/httpd24/src/modules/perl/modperl_config.c (original)
+++ perl/modperl/branches/httpd24/src/modules/perl/modperl_config.c Thu Jul 28
12:53:35 2011
@@ -479,7 +479,13 @@ typedef struct {
PerlInterpreter *perl;
} svav_param_t;
-static void *svav_getstr(void *buf, size_t bufsiz, void *param)
+static
+#if AP_MODULE_MAGIC_AT_LEAST(20110329,0)
+apr_status_t
+#else
+void *
+#endif
+svav_getstr(void *buf, size_t bufsiz, void *param)
{
svav_param_t *svav_param = (svav_param_t *)param;
dTHXa(svav_param->perl);
@@ -488,7 +494,11 @@ static void *svav_getstr(void *buf, size
STRLEN n_a;
if (svav_param->ix > AvFILL(av)) {
+#if AP_MODULE_MAGIC_AT_LEAST(20110329,0)
+ return APR_EOF;
+#else
return NULL;
+#endif
}
sv = AvARRAY(av)[svav_param->ix++];
@@ -496,7 +506,11 @@ static void *svav_getstr(void *buf, size
apr_cpystrn(buf, SvPVX(sv), bufsiz);
+#if AP_MODULE_MAGIC_AT_LEAST(20110329,0)
+ return APR_SUCCESS;
+#else
return buf;
+#endif
}
const char *modperl_config_insert(pTHX_ server_rec *s,
Modified: perl/modperl/branches/httpd24/src/modules/perl/modperl_module.c
URL:
http://svn.apache.org/viewvc/perl/modperl/branches/httpd24/src/modules/perl/modperl_module.c?rev=1151827&r1=1151826&r2=1151827&view=diff
==============================================================================
--- perl/modperl/branches/httpd24/src/modules/perl/modperl_module.c (original)
+++ perl/modperl/branches/httpd24/src/modules/perl/modperl_module.c Thu Jul 28
12:53:35 2011
@@ -832,7 +832,10 @@ const char *modperl_module_add(apr_pool_
modperl_module_insert(modp);
- ap_add_loaded_module(modp, p);
+ if ((errmsg = mp_add_loaded_module(modp, p, modp->name))) {
+ perl_module.next = modp->next;
+ return errmsg;
+ }
apr_pool_cleanup_register(p, modp, modperl_module_remove,
apr_pool_cleanup_null);
Modified: perl/modperl/branches/httpd24/src/modules/perl/modperl_pcw.c
URL:
http://svn.apache.org/viewvc/perl/modperl/branches/httpd24/src/modules/perl/modperl_pcw.c?rev=1151827&r1=1151826&r2=1151827&view=diff
==============================================================================
--- perl/modperl/branches/httpd24/src/modules/perl/modperl_pcw.c (original)
+++ perl/modperl/branches/httpd24/src/modules/perl/modperl_pcw.c Thu Jul 28
12:53:35 2011
@@ -27,7 +27,11 @@ void ap_pcw_walk_location_config(apr_poo
ap_pcw_dir_cb_t dir_cb, void *data)
{
int i;
- ap_conf_vector_t **urls = (ap_conf_vector_t **)sconf->sec_url->elts;
+ ap_conf_vector_t **urls;
+
+ if( !sconf->sec_url ) return;
+
+ urls = (ap_conf_vector_t **)sconf->sec_url->elts;
for (i = 0; i < sconf->sec_url->nelts; i++) {
core_dir_config *conf =
@@ -46,7 +50,11 @@ void ap_pcw_walk_directory_config(apr_po
ap_pcw_dir_cb_t dir_cb, void *data)
{
int i;
- ap_conf_vector_t **dirs = (ap_conf_vector_t **)sconf->sec_dir->elts;
+ ap_conf_vector_t **dirs;
+
+ if( !sconf->sec_dir ) return;
+
+ dirs = (ap_conf_vector_t **)sconf->sec_dir->elts;
for (i = 0; i < sconf->sec_dir->nelts; i++) {
core_dir_config *conf =
@@ -65,7 +73,11 @@ void ap_pcw_walk_files_config(apr_pool_t
ap_pcw_dir_cb_t dir_cb, void *data)
{
int i;
- ap_conf_vector_t **dirs = (ap_conf_vector_t **)dconf->sec_file->elts;
+ ap_conf_vector_t **dirs;
+
+ if( !dconf->sec_file ) return;
+
+ dirs = (ap_conf_vector_t **)dconf->sec_file->elts;
for (i = 0; i < dconf->sec_file->nelts; i++) {
core_dir_config *conf =
Modified: perl/modperl/branches/httpd24/t/response/TestAPI/add_config.pm
URL:
http://svn.apache.org/viewvc/perl/modperl/branches/httpd24/t/response/TestAPI/add_config.pm?rev=1151827&r1=1151826&r2=1151827&view=diff
==============================================================================
--- perl/modperl/branches/httpd24/t/response/TestAPI/add_config.pm (original)
+++ perl/modperl/branches/httpd24/t/response/TestAPI/add_config.pm Thu Jul 28
12:53:35 2011
@@ -100,7 +100,8 @@ sub handler : method {
my $expect = Apache2::Const::OPT_ALL |
Apache2::Const::OPT_UNSET |
- Apache2::Const::OPT_INCNOEXEC |
+ (defined &Apache2::Const::OPT_INCNOEXEC
+ ? Apache2::Const::OPT_INCNOEXEC() : 0) |
Apache2::Const::OPT_MULTI |
Apache2::Const::OPT_SYM_OWNER;
Modified: perl/modperl/branches/httpd24/xs/Apache2/Access/Apache2__Access.h
URL:
http://svn.apache.org/viewvc/perl/modperl/branches/httpd24/xs/Apache2/Access/Apache2__Access.h?rev=1151827&r1=1151826&r2=1151827&view=diff
==============================================================================
--- perl/modperl/branches/httpd24/xs/Apache2/Access/Apache2__Access.h (original)
+++ perl/modperl/branches/httpd24/xs/Apache2/Access/Apache2__Access.h Thu Jul
28 12:53:35 2011
@@ -19,7 +19,12 @@ static MP_INLINE SV *mpxs_ap_requires(pT
AV *av;
HV *hv;
register int x;
- const apr_array_header_t *reqs_arr = ap_requires(r);
+ const apr_array_header_t *reqs_arr =
+#if AP_SERVER_MAJORVERSION_NUMBER>2 || AP_SERVER_MINORVERSION_NUMBER>=3
+ 0;
+#else
+ ap_requires(r);
+#endif
require_line *reqs;
if (!reqs_arr) {
Modified: perl/modperl/branches/httpd24/xs/Apache2/Log/Apache2__Log.h
URL:
http://svn.apache.org/viewvc/perl/modperl/branches/httpd24/xs/Apache2/Log/Apache2__Log.h?rev=1151827&r1=1151826&r2=1151827&view=diff
==============================================================================
--- perl/modperl/branches/httpd24/xs/Apache2/Log/Apache2__Log.h (original)
+++ perl/modperl/branches/httpd24/xs/Apache2/Log/Apache2__Log.h Thu Jul 28
12:53:35 2011
@@ -48,13 +48,13 @@ static void mpxs_ap_log_error(pTHX_ int
s = modperl_global_get_server_rec();
}
- if ((lmask == APLOG_DEBUG) && (s->loglevel >= APLOG_DEBUG)) {
+ if ((lmask >= APLOG_DEBUG) && (mp_loglevel(s) >= APLOG_DEBUG)) {
COP *cop = PL_curcop;
file = CopFILE(cop); /* (caller)[1] */
line = CopLINE(cop); /* (caller)[2] */
}
- if ((s->loglevel >= lmask) &&
+ if ((mp_loglevel(s) >= lmask) &&
SvROK(msg) && (SvTYPE(SvRV(msg)) == SVt_PVCV)) {
dSP;
ENTER;SAVETMPS;
@@ -72,10 +72,12 @@ static void mpxs_ap_log_error(pTHX_ int
}
if (r) {
- ap_log_rerror(file, line, level, 0, r, "%s", str);
+ ap_log_rerror(file, line, mp_module_index_ level, 0, r,
+ "%s", str);
}
else {
- ap_log_error(file, line, level, 0, s, "%s", str);
+ ap_log_error(file, line, mp_module_index_ level, 0, s,
+ "%s", str);
}
if (svstr) {
@@ -258,10 +260,12 @@ MP_STATIC XS(MPXS_Apache2__Log_log_xerro
msgstr = SvPV(msgsv, n_a);
if (r) {
- ap_log_rerror(file, line, level, status, r, "%s", msgstr);
+ ap_log_rerror(file, line, mp_module_index_ level, status, r,
+ "%s", msgstr);
}
else {
- ap_log_error(file, line, level, status, s, "%s", msgstr);
+ ap_log_error(file, line, mp_module_index_ level, status, s,
+ "%s", msgstr);
}
SvREFCNT_dec(msgsv);
Added: perl/modperl/branches/httpd24/xs/Apache2/ServerRec/Apache2__ServerRec.h
URL:
http://svn.apache.org/viewvc/perl/modperl/branches/httpd24/xs/Apache2/ServerRec/Apache2__ServerRec.h?rev=1151827&view=auto
==============================================================================
--- perl/modperl/branches/httpd24/xs/Apache2/ServerRec/Apache2__ServerRec.h
(added)
+++ perl/modperl/branches/httpd24/xs/Apache2/ServerRec/Apache2__ServerRec.h Thu
Jul 28 12:53:35 2011
@@ -0,0 +1,19 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#if AP_SERVER_MAJORVERSION_NUMBER>2 || AP_SERVER_MINORVERSION_NUMBER>=3
+#define loglevel log.level
+#endif
Modified:
perl/modperl/branches/httpd24/xs/Apache2/ServerUtil/Apache2__ServerUtil.h
URL:
http://svn.apache.org/viewvc/perl/modperl/branches/httpd24/xs/Apache2/ServerUtil/Apache2__ServerUtil.h?rev=1151827&r1=1151826&r2=1151827&view=diff
==============================================================================
--- perl/modperl/branches/httpd24/xs/Apache2/ServerUtil/Apache2__ServerUtil.h
(original)
+++ perl/modperl/branches/httpd24/xs/Apache2/ServerUtil/Apache2__ServerUtil.h
Thu Jul 28 12:53:35 2011
@@ -157,8 +157,8 @@ SV *mpxs_Apache2__ServerRec_get_handlers
#define mpxs_Apache2__ServerUtil_server(classname)
modperl_global_get_server_rec()
#if !defined(OS2) && !defined(WIN32) && !defined(BEOS) && !defined(NETWARE)
-#define mpxs_Apache2__ServerUtil_user_id(classname) unixd_config.user_id
-#define mpxs_Apache2__ServerUtil_group_id(classname) unixd_config.group_id
+#define mpxs_Apache2__ServerUtil_user_id(classname) ap_unixd_config.user_id
+#define mpxs_Apache2__ServerUtil_group_id(classname) ap_unixd_config.group_id
#else
#define mpxs_Apache2__ServerUtil_user_id(classname) 0
#define mpxs_Apache2__ServerUtil_group_id(classname) 0
Modified: perl/modperl/branches/httpd24/xs/maps/apache2_functions.map
URL:
http://svn.apache.org/viewvc/perl/modperl/branches/httpd24/xs/maps/apache2_functions.map?rev=1151827&r1=1151826&r2=1151827&view=diff
==============================================================================
--- perl/modperl/branches/httpd24/xs/maps/apache2_functions.map (original)
+++ perl/modperl/branches/httpd24/xs/maps/apache2_functions.map Thu Jul 28
12:53:35 2011
@@ -41,7 +41,14 @@ MODULE=Apache2::RequestUtil
MODULE=Apache2::RequestUtil PACKAGE=guess
ap_psignature | | r, prefix
>ap_finalize_request_protocol
+#_if_ do { \
+ Apache2::Build->build_config \
+ ->httpd_version =~ /^(\d+)\.(\d+)\.(\d+)/ \
+ ? ($1*1000+$2)*1000+$3 \
+ : die "Cannot get httpd version"; \
+ } < 2003000
ap_default_type
+#_end_
ap_get_server_name
ap_get_server_port
!ap_content_type_tolower
Modified:
perl/modperl/branches/httpd24/xs/tables/current/Apache2/ConstantsTable.pm
URL:
http://svn.apache.org/viewvc/perl/modperl/branches/httpd24/xs/tables/current/Apache2/ConstantsTable.pm?rev=1151827&r1=1151826&r2=1151827&view=diff
==============================================================================
--- perl/modperl/branches/httpd24/xs/tables/current/Apache2/ConstantsTable.pm
(original)
+++ perl/modperl/branches/httpd24/xs/tables/current/Apache2/ConstantsTable.pm
Thu Jul 28 12:53:35 2011
@@ -53,6 +53,7 @@ $Apache2::ConstantsTable = {
'OPT_EXECCGI',
'OPT_UNSET',
'OPT_INCNOEXEC',
+ 'OPT_INC_WITH_EXEC',
'OPT_SYM_OWNER',
'OPT_MULTI',
'OPT_ALL'