perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Lochmatter" <sourcefo...@lothosoft.ch>
Subject Re: [bug] Apache::FakeRequest::content_languages
Date Wed, 01 Sep 2004 09:08:19 GMT
You're right: both methods (content_languages() and
content_language()) work on the Apache object, although
only content_languages() is documented (perldoc Apache)!

Since Apache::FakeRequest wants to be a complete fake
object, it should implement both methods as well, I think.
Hence, the patch would be to add content_languages()
instead of replacing content_language().

-- Thomas

Um Fri, 27 Aug 2004 19:25:41 -0700
 schrieb Stas Bekman <stas@stason.org>:
> Thomas Lochmatter wrote:
> > (ModPerl 1.29, Apache.pm 1.27, FakeRequest.pm 1.00)
> > 
> > In the Apache::FakeRequest module, there is a method
> called
> > "content_language". The Apache module however calls
> this
> > method "content_languages".
> > 
> > I guess this is a bug. It could be corrected by
> changing
> > FakeRequest.pm, line 20:
> > <  content content_encoding content_language
> > 
> >> content content_encoding content_languages
> 
> Why do you think it's a bug? there are both
> content_language and content_languages in
> src/modules/perl/Apache.xs:
> 
> char *
> content_language(r, ...)
>      Apache	r
> 
>      CODE:
>      get_set_PVp(r->content_language,r->pool);
> 
>      OUTPUT:
>      RETVAL
> 
> void
> content_languages(r, avrv=Nullsv)
>      Apache	r
>      SV *avrv
> 
>      PREINIT:
>      I32 gimme = GIMME_V;
> 
>      CODE:
>      if(avrv && SvROK(avrv))
>          r->content_languages = avrv2array_header(avrv,
> r->pool);
> 
>      if(gimme != G_VOID)
>          ST(0) = array_header2avrv(r->content_languages);
> 
> -- 
>
__________________________________________________________________
> 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


-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Mime
View raw message