mpxs_Apache__RequestRec_new is another problematic method. it segfaults if adding a magic:

Index: xs/Apache/RequestUtil/Apache__RequestUtil.h
===================================================================
--- xs/Apache/RequestUtil/Apache__RequestUtil.h (revision 123255)
+++ xs/Apache/RequestUtil/Apache__RequestUtil.h (working copy)
@@ -54,17 +54,21 @@
  */

 static MP_INLINE
-request_rec *mpxs_Apache__RequestRec_new(SV *classname,
-                                         conn_rec *c,
-                                         apr_pool_t *base_pool)
+SV *mpxs_Apache__RequestRec_new(pTHX_ SV *classname,
+                                conn_rec *c,
+                                SV *base_pool_sv)
 {
-    apr_pool_t *p;
+    apr_pool_t *p, *base_pool;
     request_rec *r;
     server_rec *s = c->base_server;
-
+    SV *r_sv;
+
     /* see: httpd-2.0/server/protocol.c:ap_read_request */

-    if (!base_pool) {
+    if (base_pool_sv) {
+        base_pool = mp_xs_sv2_APR__Pool(base_pool_sv);
+    }
+    else {
         base_pool = c->pool;
     }

@@ -113,7 +117,13 @@
     r->assbackwards    = 1;
     r->protocol        = "UNKNOWN";

-    return r;
+    r_sv = sv_setref_pv(NEWSV(0, 0), "Apache::RequestRec", (void*)r);
+
+    if (base_pool_sv) {
+        mpxs_add_pool_magic(r_sv, base_pool_sv);
+    }
+
+    return r_sv;
 }

 static MP_INLINE


I'm also thinking whether we should do that magic decorating only for custom pools or for native pools as well. I think this should be done only for custom pools, since native pools destruction timing is not under our control anyway.



-- __________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to