perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brett @Google" <brett.maxfi...@gmail.com>
Subject apache 2.4.x and mod_perl 2.0
Date Wed, 14 Mar 2012 09:35:40 GMT
Hi All,

Apache 2.4.x seems to have changed / deprecated things.. things i have noticed :

in ./src/modules/perl/modperl_constants.c if OPT_INCNOEXEC is not
present, as OPT_INCNOEXEC is now OPT_INCLUDES

c->remote_ip gone, and now split into c->client_ip (tcp endpoint) and
c->useragent_ip (e.g. X-Forwarded-For)

add 3rd argument to ap_add_loaded_module, giving the module's name

remove OPT_INCNOEXEC from ./src/modules/perl/modperl_constants.c -
ifdef it based on presence of OPT_INCNOEXEC

does anybody know the correct way to make the .xs files represent the
*.h defines, for things like OPT_INCNOEXEC rather than hand editing
them ?

eg. It sill has the old c->remote_ip symbols which look like they
might have been originally parsed from the apache source (but not by
default in a build) :

cc -c  -I/home/govops/build-new/mod_perl-2.0-svn/src/modules/perl
-I/home/govops/build-new/mod_perl-2.0-svn/xs
-I/usr/local/directory-libs/include/apr-1
-I/usr/local/apache24/include  -D_REENTRANT -xtarget=ultraT1
-xcode=pic32 -m64 -xarch=generic64 -DDEBUGGING -I/usr/local/include
-DPERL_USE_SAFE_PUTENV -DMOD_PERL -DMP_COMPAT_1X -DSOLARIS2=10
-D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT -O3 -g
-DVERSION=\"2.000006\"  -DXS_VERSION=\"2.000006\" -KPIC
"-I/usr/local/directory-libs/lib/perl5/5.12.2/sun4-solaris-thread-multi-64/CORE"
 -DMP_HAVE_APR_LIBS Connection.c
"Connection.xs", line 117: undefined struct/union member: remote_addr
"Connection.xs", line 134: undefined struct/union member: remote_ip
"Connection.xs", line 138: improper member use: remote_ip
"Connection.xs", line 139: warning: improper pointer/integer combination: op "="
cc: acomp failed for Connection.c
*** Error code 2
make: Fatal error: Command failed for target `Connection.o'
Current working directory
/home/govops/build-new/mod_perl-2.0-svn/WrapXS/Apache2/Connection
*** Error code 1

Cheers
Brett

My local random edits so far are:

svn diff
Index: src/modules/perl/modperl_module.c
===================================================================
--- src/modules/perl/modperl_module.c   (revision 1300466)
+++ src/modules/perl/modperl_module.c   (working copy)
@@ -832,7 +832,7 @@

     modperl_module_insert(modp);

-    ap_add_loaded_module(modp, p);
+    ap_add_loaded_module(modp, p, modp->name);

     apr_pool_cleanup_register(p, modp, modperl_module_remove,
                               apr_pool_cleanup_null);
Index: src/modules/perl/modperl_apache_compat.h
===================================================================
--- src/modules/perl/modperl_apache_compat.h    (revision 1300466)
+++ src/modules/perl/modperl_apache_compat.h    (working copy)
@@ -68,7 +68,7 @@
 #define MP_HTTPD_OVERRIDE_OPTS_UNSET (-1)
 #define MP_HTTPD_OVERRIDE_OPTS_DEFAULT (OPT_UNSET | \
                                         OPT_ALL |
\
-                                        OPT_INCNOEXEC
| \
+                                        OPT_INCLUDES
| \
                                         OPT_SYM_OWNER
| \
                                         OPT_MULTI)

Index: src/modules/perl/modperl_interp.c
===================================================================
--- src/modules/perl/modperl_interp.c   (revision 1300466)
+++ src/modules/perl/modperl_interp.c   (working copy)
@@ -500,7 +500,7 @@
                    "set interp 0x%lx in %s 0x%lx (%s request for %s)\n",
                    (unsigned long)interp, desc, (unsigned long)p,
                    (r ? (is_subrequest ? "sub" : "main") : "conn"),
-                   (r ? r->uri : c->remote_ip));
+                   (r ? r->uri : c->client_ip));
     }

     /* set context (THX) for this thread */

--
The only thing that interferes with my learning is my education.

Albert Einstein

Mime
View raw message