perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <>
Subject Re: [Fwd: Re: [rfc] APR::Table & polymorphic values]
Date Thu, 05 Jun 2003 03:49:46 GMT
>>Joe Schaefer wrote:

>>>>What if you use mpxs_apr_table_do to fixup the elements on the first
>>>>FETCH? Would that be a bad approach?
>>>Not sure what you have in mind.
>>you can run filter on all pairs in the table, see
> I still don't see how that's useful here.  There's nothing 
> wrong with the data inside apr_table.  It's the c2perl
> translation (newSVpv) that's causing the lossage.

and I don't get where the lossage is :(

>>>>The problem is that I still don't understand what do you need that
>>>>meta data for and how is it used.
>>>  1) the perl-glue for apreq will finally be able to handle embedded
>>>     nul characters,
>>>  2) we can duplicate's overloading of params, since file-uploads
>>>     are just params with a non-NULL bucket-brigade attached.
>>>  3) we can do lots of cool stuff with cookie values, too.
>>Any examples of how is it used?
> Nothing solid API-wise, since the perl API needs to be discussed on 
> apreq-dev.  But given all the recent confusion on modperl@ over the 
> Cookie API, there's good reason to simplify the API.  What I'd like to
> do is push the idea of params & cookies of being _values_ with _objects_ 
> attached to them, instead of the other way around (which is what we
> do in apreq-1).  So for example, if you want to get at the 'foo' 
> cookie, I'd rather write something like
>   my $jar = Apacke::Cookie->fetch($r); # ref(jar) = Apache::Cookie::Table
>   my $foo = $jar->{'foo'};             # $cookie_obj = tied $foo;
> instead of the current monstrosity:
>   my $jar = Apache::Cookie->fetch;
>   my $cookie_obj = $jar->{'foo'};
>   my $foo = $cookie && $cookie_obj->value;
> The '&&' test is both necessary and really fugly.
> [...]

That's cool. But Joe, you don't seem to understand what I'm asking you about. 
I want to see an example of a conversion function where this meta data kicks 
in. I don't seem to get into your head to see things the same way you do.

>>I can't see where the meta data is in str. Is it before str?
> Yes, the metadata is ALWAYS right before str!  str is 
> pointer to the _end_ of an apreq struct 
> (str == param-> or str == cookie->
> Patch attached- hopefully this will clarify the issues.  Please comment.

I can't intelligently comment on the patch, before I can understand why is it 
needed :(

One thing I can tell is that it won't work with ithreads-disabled perl.

Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker     mod_perl Guide --->

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message