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/05/17 20:10:23 UTC

a few compat layer questions

I'm working on completing the compat.pod doc:
http://perl.apache.org/release/docs/2.0/user/compat/compat.html
and have a few questions:

---

err_header_out() is not available in 2.x. We sugest to use 
err_headers_out() instead. but we don't have it in the compat layer.

Should we implement it in Apache::compat similar to header_out()?

---

$r->content() was dropped. should we provide some wrapper to be part
of 2.0 API, similar to the content() wrapper in Apache::compat?

also why was this method dropped? was it because now there are different
request bodies?

---

chdir_file() can be implemented the same way it was on 1.x, for
non-threaded mpms, no? So if we implement it with ifdef it won't be good 
because then the user code won't work on the threaded mpm?

__________________________________________________________________
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: a few compat layer questions

Posted by Doug MacEachern <do...@covalent.net>.
On Sun, 19 May 2002, Stas Bekman wrote:
 
> I beg your pardon? I cannot find any reference of you saying anything 
> regarding $r->content.

i'm certain i've at least stated several times that $r->content and 
$r->args in-an-array-context were mistakes that never should have been 
part of the api.  and was pretty sure most the reasons why were well known 
too.  anyhow, here's a couple of reasons:

- does not handle multi-value keys

- does not handle multi-part content types

- does not handle chunked encoding

- slurps r->headers_in->{'content-length'} into a single buffer
  (bad for performance, memory bloat, possible dos attack, etc.)

- in general duplicates functionality (and does so poorly) that is done 
  better in Apache::Request

- if one wishes to simply read POST data, there is the more modern
  {setup,should,get}_client_block api, and even more modern filter
  api.  along with continued support for read(STDIN, ...) and
  $r->read($buf, $r->headers_in->{'content-length'})



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


Re: a few compat layer questions

Posted by Stas Bekman <st...@stason.org>.
Doug MacEachern wrote:
> On Sat, 18 May 2002, Stas Bekman wrote:
> 
> 
>>err_header_out() is not available in 2.x. We sugest to use 
>>err_headers_out() instead. but we don't have it in the compat layer.
>>
>>Should we implement it in Apache::compat similar to header_out()?
> 
> 
> yes.

done

>>$r->content() was dropped. should we provide some wrapper to be part
>>of 2.0 API, similar to the content() wrapper in Apache::compat?
> 
> 
> no, Apache::compat is all we provide.
>  
> 
>>also why was this method dropped? was it because now there are different
>>request bodies?
> 
> 
> are you kidding?!?  how many times now have i explained why $r->args in an 
> array context and $r->content have been dropped??

I beg your pardon? I cannot find any reference of you saying anything 
regarding $r->content.

>>chdir_file() can be implemented the same way it was on 1.x, for
>>non-threaded mpms, no? So if we implement it with ifdef it won't be good 
>>because then the user code won't work on the threaded mpm?
> 
> not worth the trouble.  whatever chdir solution is used for threaded mpms 
> should be good enough to use with prefork too.

I understand.

__________________________________________________________________
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: a few compat layer questions

Posted by Doug MacEachern <do...@covalent.net>.
On Sat, 18 May 2002, Stas Bekman wrote:

> err_header_out() is not available in 2.x. We sugest to use 
> err_headers_out() instead. but we don't have it in the compat layer.
> 
> Should we implement it in Apache::compat similar to header_out()?

yes.
 
> $r->content() was dropped. should we provide some wrapper to be part
> of 2.0 API, similar to the content() wrapper in Apache::compat?

no, Apache::compat is all we provide.
 
> also why was this method dropped? was it because now there are different
> request bodies?

are you kidding?!?  how many times now have i explained why $r->args in an 
array context and $r->content have been dropped??

> chdir_file() can be implemented the same way it was on 1.x, for
> non-threaded mpms, no? So if we implement it with ifdef it won't be good 
> because then the user code won't work on the threaded mpm?

not worth the trouble.  whatever chdir solution is used for threaded mpms 
should be good enough to use with prefork too.


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