You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Stas Bekman <st...@stason.org> on 2002/04/09 13:22:35 UTC

missing 2.0 APIs

Are we going to add the Apache::Server->pool function? we already have 
the C code: modperl_sv2pool. I need it for RegistryLoader in 
server_root_relative(). I see the item of using pconf in startup, but 
why not Apache::Server->pool via modperl_sv2pool? I suppose that's 
because now we may have different servers, right?

I could create a new pool via APR::Pool->new(), but I don't think this 
is right.

Also I forgot, what's the alternative to %args=$r->args, which is 
deprecated in 2.0? Apache::Request?

Thanks!
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


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


Re: missing 2.0 APIs

Posted by Stas Bekman <st...@stason.org>.
Doug MacEachern wrote:
> On Wed, 10 Apr 2002, Stas Bekman wrote:
>  
> 
>>BTW, Apache::Server->process segfaults (after rebuild), bt at the end.
> 
> 
> try Apache->server->process, i'll fix the other one later.

that works.

>>I thought the deprecation was about not doing it on the modperl side. If 
>>we just provide a glue code, what's wrong with 
>>parsing-in-an-array-context? By this context you mean:
>>
>>   @args = $r->args; ?
> 
> 
> yeah, that's what i mean.  we're not supporting that in the core in 2.0.
> but you can change the Apache::compat version to use httpd builtin parsing 
> code if/when it gets there.

ok, thanks.

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


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


Re: missing 2.0 APIs

Posted by Doug MacEachern <do...@covalent.net>.
On Wed, 10 Apr 2002, Stas Bekman wrote:
 
> BTW, Apache::Server->process segfaults (after rebuild), bt at the end.

try Apache->server->process, i'll fix the other one later.

> I thought the deprecation was about not doing it on the modperl side. If 
> we just provide a glue code, what's wrong with 
> parsing-in-an-array-context? By this context you mean:
> 
>    @args = $r->args; ?

yeah, that's what i mean.  we're not supporting that in the core in 2.0.
but you can change the Apache::compat version to use httpd builtin parsing 
code if/when it gets there.


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


Re: missing 2.0 APIs

Posted by Stas Bekman <st...@stason.org>.
Doug MacEachern wrote:
> On Wed, 10 Apr 2002, Stas Bekman wrote:
>  
> 
>>none of these look like an intuitive replacement for a pool object as a 
>>first argument :(
> 
> 
> that's done on purpose.  if you're not going to pass in an APR::Pool 
> object, you should know what you're doing.  that is, pretend we supported 
> Apache::server_root_relative("logs");
> much too easy for that to slip into code that is run at request time, 
> making that code leak and unthread safe.

of course. That's why I wanted to have an explicit pool object to pass. 
Before your last minute's commit there was no way to get it, other than 
creating APR::Pool->new.

BTW, Apache::Server->process segfaults (after rebuild), bt at the end.

>>Among other things, I've started porting apreq. If we get it into the 
>>httpd-2.0 core before it gets released, can we use this lib's 
>>functionality for parsing args as part of the modperl core? Do we have 
>>any other alternatives other than the slow CGI.pm?
> 
> 
> if the functions are in httpd-2.0 we will provide the direct mapping as 
> Apache::Request does now.

good

> $r->args parsing-in-an-array-context would still be deprecated.

I thought the deprecation was about not doing it on the modperl side. If 
we just provide a glue code, what's wrong with 
parsing-in-an-array-context? By this context you mean:

   @args = $r->args; ?
---
bt:

#0  0x403e529a in Perl_mg_get (my_perl=0x81a7218, sv=0x828f260) at mg.c:119
#1  0x40405aa4 in Perl_sv_2iv (my_perl=0x81a7218, sv=0x828f260) at sv.c:2011
#2  0x405272ba in XS_Apache__Server_process (my_perl=0x81a7218, 
cv=0x823f6b4)
     at Server.c:53
#3  0x40401300 in Perl_pp_entersub (my_perl=0x81a7218) at pp_hot.c:2730
#4  0x403dd489 in Perl_runops_debug (my_perl=0x81a7218) at dump.c:1393
#5  0x40381470 in S_call_body (my_perl=0x81a7218, myop=0xbffff1e0, 
is_eval=1)
     at perl.c:2005
#6  0x4038171a in Perl_eval_sv (my_perl=0x81a7218, sv=0x81a7dcc, flags=2)
     at perl.c:2065
#7  0x40381d00 in Perl_require_pv (my_perl=0x81a7218,
     pv=0x8161470 
"/home/stas/apache.org/mp-sb/ModPerl-Registry/t/conf/modperl_extra_startup.pl") 
at perl.c:2163



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


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


Re: missing 2.0 APIs

Posted by Doug MacEachern <do...@covalent.net>.
On Wed, 10 Apr 2002, Stas Bekman wrote:
 
> none of these look like an intuitive replacement for a pool object as a 
> first argument :(

that's done on purpose.  if you're not going to pass in an APR::Pool 
object, you should know what you're doing.  that is, pretend we supported 
Apache::server_root_relative("logs");
much too easy for that to slip into code that is run at request time, 
making that code leak and unthread safe.

> Among other things, I've started porting apreq. If we get it into the 
> httpd-2.0 core before it gets released, can we use this lib's 
> functionality for parsing args as part of the modperl core? Do we have 
> any other alternatives other than the slow CGI.pm?

if the functions are in httpd-2.0 we will provide the direct mapping as 
Apache::Request does now.
$r->args parsing-in-an-array-context would still be deprecated.


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


Re: missing 2.0 APIs

Posted by Stas Bekman <st...@stason.org>.
Doug MacEachern wrote:
> On Tue, 9 Apr 2002, Stas Bekman wrote:
> 
> 
>>Are we going to add the Apache::Server->pool function? we already have 
> 
> 
> no.  but we can enable Apache::Server->process->{pconf,pool}

+1

>>the C code: modperl_sv2pool. I need it for RegistryLoader in 
>>server_root_relative(). I see the item of using pconf in startup, but 
>>why not Apache::Server->pool via modperl_sv2pool? I suppose that's 
>>because now we may have different servers, right?
> 
> 
> you can already do this thanks to modperl_sv2pool:
> 
> Apache::server_root_relative(undef, "logs");
> Apache::server_root_relative(Apache->server, "logs");
> Apache::server_root_relative('Apache::Server', "logs");

none of these look like an intuitive replacement for a pool object as a 
first argument :(

>>Also I forgot, what's the alternative to %args=$r->args, which is 
>>deprecated in 2.0? Apache::Request?
>  
> i have no idea.  all i know is $r->args parsing does not belong where it 
> did in modperl 1.x.

Among other things, I've started porting apreq. If we get it into the 
httpd-2.0 core before it gets released, can we use this lib's 
functionality for parsing args as part of the modperl core? Do we have 
any other alternatives other than the slow CGI.pm?

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


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


Re: missing 2.0 APIs

Posted by Doug MacEachern <do...@covalent.net>.
On Tue, 9 Apr 2002, Stas Bekman wrote:

> Are we going to add the Apache::Server->pool function? we already have 

no.  but we can enable Apache::Server->process->{pconf,pool}

> the C code: modperl_sv2pool. I need it for RegistryLoader in 
> server_root_relative(). I see the item of using pconf in startup, but 
> why not Apache::Server->pool via modperl_sv2pool? I suppose that's 
> because now we may have different servers, right?

you can already do this thanks to modperl_sv2pool:

Apache::server_root_relative(undef, "logs");
Apache::server_root_relative(Apache->server, "logs");
Apache::server_root_relative('Apache::Server', "logs");
 
> Also I forgot, what's the alternative to %args=$r->args, which is 
> deprecated in 2.0? Apache::Request?

i have no idea.  all i know is $r->args parsing does not belong where it 
did in modperl 1.x.



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