httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randy Kobes <ra...@theoryx5.uwinnipeg.ca>
Subject Re: cvs commit: httpd-apreq-2/build xsbuilder.pl
Date Fri, 31 Oct 2003 18:44:26 GMT
On Fri, 31 Oct 2003, Joe Schaefer wrote:

> Randy Kobes <randy@theoryx5.uwinnipeg.ca> writes:
>
> [...]
>
> > Until things are arranged so that all the needed APR::* can
> > be used outside of mp2, I've been looking at the perl glue
> > in a CGI context, just to see what's involved. This entails
> > having available mod_perl.so as an so/dll. Although this may
> > not be the best model, I tried the following, just to see if
> > it works:
>
> Cool.
>
> > - make an Apreq::Base, consisting of a Base.xs that just
> > made available apr_initialize() and apr_terminate2().
> > - make an Apreq::Request which loads Apreq::Base and has
> > a new() method to create an Apreq::Request object by
> >     - calling apr_initialize()
> >     - creating a $p = APR::Pool->new()
> >     - creating a $req = Apache::Request->new($p, @_)
> > - make an Apreq::Cookie which similarly passes a $p pool
> > in as the $env within Apache/Cookie.pm.
> > - I'm not sure about this, but I also made a DESTROY sub
> > which calls apr_terminate2().
>
> initialize/terminate are per-process events, so calling them
> from the object ctor/dtor is probably a mistake.  IMO those calls
> probably belong inside BEGIN and END blocks within APR.pm.
> If that were so, Base.xs would be unnecessary, right?

That does seem right, and as Stas noted, APR.xs does that
already. But when I tried the apreq stuff from within a CGI
environment just by using APR and APR::Pool, things crashed,
which was cured by putting in the apr_initialize() call from
Apreq::Base (I'm not sure if this problem is at all related
to the disabling of some of the mp2 apr-ext/ tests?). I'll
look at this in more detail, though - you're right that in
principle an Apreq::Base like this shouldn't be needed, or
even done.

In any event, I did this more as a proof of concept, in that
it shows things seem workable in principle within a cgi
environment, and even from within the current state of mp2
where mod_perl.so must be used (as an so providing some
symbols). Is the perl glue something that you think should
be persued to more detail now, or should we wait until the
necessary symbols needed from mod_perl.so are moved
elsewhere?

-- 
best regards,
randy

Mime
View raw message