On 06/23/2013 10:21 PM, Niko Tyni wrote:
We're seeing just one test failure with the httpd24 branch
and Apache 2.4.4:

# Failed test 1 in t/directive/perlloadmodule3.t at line 38

This is an API change in Apache 2.4: the server_rec struct member types
have changed. In this case, is_virtual used to be an 'int' but is now a
'char'.

  
http://svn.apache.org/viewvc/httpd/httpd/trunk/include/httpd.h?r1=959392&r2=959464

Clearly mod_perl2 needs to somehow map the char to a Perl number. The
test failure happens because the zero byte "\0" is true in Perl and
so the is_virtual method always returns true.

I couldn't find existing infrastructure to do this mapping but maybe
I'm just missing it?

Try it with attached patch. I haven't tried to run the tests with the patch applied, but from the generated code it looks like it should return int now.

Regards,
Jan Kaluza

Index: xs/Apache2/ServerRec/Apache2__ServerRec.h
===================================================================
--- xs/Apache2/ServerRec/Apache2__ServerRec.h	(revision 1495981)
+++ xs/Apache2/ServerRec/Apache2__ServerRec.h	(working copy)
@@ -16,4 +16,17 @@
 
 #if AP_SERVER_MAJORVERSION_NUMBER>2 || AP_SERVER_MINORVERSION_NUMBER>=3
 #define loglevel log.level
+
+static MP_INLINE
+int mpxs_Apache2__ServerRec_is_virtual(pTHX_ server_rec *s, SV *val)
+{
+    int retval = s->is_virtual;
+
+    if (val) {
+        s->is_virtual = SvIV(val);
+    }
+
+    return retval;
+}
+
 #endif
Index: xs/maps/apache2_structures.map
===================================================================
--- xs/maps/apache2_structures.map	(revision 1495981)
+++ xs/maps/apache2_structures.map	(working copy)
@@ -99,7 +99,7 @@
 %  error_fname
 $  error_log
 $  loglevel
-<  is_virtual
+~  is_virtual
 <  module_config
 <  lookup_defaults
 <  addrs
Index: xs/maps/modperl_functions.map
===================================================================
--- xs/maps/modperl_functions.map	(revision 1495981)
+++ xs/maps/modperl_functions.map	(working copy)
@@ -21,6 +21,9 @@
  mpxs_Apache2__RequestRec_finfo | | r, finfo=NULL
  mpxs_Apache2__RequestRec_handler | | ...
  mpxs_Apache2__RequestRec_content_languages | | r, languages=(SV *)NULL
+,
+MODULE=Apache2::ServerRec   PACKAGE=Apache2::ServerRec
+ mpxs_Apache2__ServerRec_is_virtual       | | server_rec *:s, val=(SV *)NULL
 
 MODULE=Apache2::RequestUtil   PACKAGE=guess
  mpxs_Apache2__RequestRec_push_handlers

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@perl.apache.org
For additional commands, e-mail: dev-h...@perl.apache.org

Reply via email to