You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apreq-dev@httpd.apache.org by Fred Moyer <fr...@redhotpenguin.com> on 2011/02/05 06:14:09 UTC

Re: svn commit: r1067389 - in /httpd/apreq/trunk/glue/perl/lib/APR/Request: ./ Magic.pm

On Fri, Feb 4, 2011 at 9:04 PM,  <jo...@apache.org> wrote:
> Author: joes
> Date: Sat Feb  5 05:04:58 2011
> New Revision: 1067389
>
> URL: http://svn.apache.org/viewvc?rev=1067389&view=rev
> Log:
> class for writing apreq code portable across cgi/mp2

Is this for the issue Mark reported?

==============================================================================
> --- httpd/apreq/trunk/glue/perl/lib/APR/Request/Magic.pm (added)
> +++ httpd/apreq/trunk/glue/perl/lib/APR/Request/Magic.pm Sat Feb  5 05:04:58 2011
> @@ -0,0 +1,18 @@
> +package APR::Request::Magic;
> +require base;
> +eval { require APR::Request::Apache2; };
> +if ($@) {
> +    require APR::Request::CGI;
> +    require APR::Pool;
> +    base->import("APR::Pool");
> +    *handle = *APR::Request::CGI::handle;
> +    *new = sub { bless APR::Pool->new, shift; };
> +    return 1;
> +}
> +require Apache2::RequestRec;
> +require Apache2::RequestUtil;

On my initial read I missed the return statement, so it might be a bit
easier to grok with this block in an 'else' section.  This looks good
though - exactly towards the Apache2::APR decoupling that I think we
need to go in mod_perl land.

> +base->import("Apache2::RequestRec");
> +*handle = *APR::Request::Apache2::handle;
> +*new = sub { bless Apache2::RequestUtil->request, shift; }
> +
> +1;
>
> Propchange: httpd/apreq/trunk/glue/perl/lib/APR/Request/Magic.pm
> ------------------------------------------------------------------------------
>    svn:eol-style = native
>
>
>