Can I change the background of the blog?
[patch] make $r->the_request writable
Hello Guest
  
  • Login
• Register…
• Start blog
  • Who, Where, When
• What can I do?
• What to Read?
  • Polls
• Avatars
• Interests
  • Cities and Countries
• Random blog
• Users search
  • Search
• Games
• Tests
• QAIX
  • Сообщества
• Talxy Chat
• Horoscope
• Online
 
Зарегистрируйся!

QAIX > Apache HTTP Server > [patch] make $r->the_request writable 8 February 2007 00:50:51

  Recent blog posts: 
  Forums:   
  Discuss: 
  Recent forum topics: 
  Recent forum comments:
  Moderators:

[patch] make $r->the_request writable

Fred Moyer 8 February 2007 00:50:51
 Greetings,

Based on the thread here:

http://marc.theaims­group.com/?l=apache-­modperl-dev&m=117002­875014012&w=2

I've put together a diff to make $r->the_request writeable. I've based
this on the writeable test for $r->hostname. The test passes on my setup.

Any suggestions on changes to this, or should I go ahead and commit it?


Index: t/response/TestAPI/­request_rec.pm
===================­====================­====================­========
--- t/response/TestAPI/­request_rec.pm (revision 500867)
+++ t/response/TestAPI/­request_rec.pm (working copy)
@@ -24,7 +24,7 @@
sub handler {
my $r = shift;

- plan $r, tests => 54;
+ plan $r, tests => 55;

#Apache2::RequestUt­il->request($r); #PerlOptions +GlobalRequest
takes care
my $gr = Apache2::RequestUti­l->request;
@@ -127,6 +127,13 @@
ok t_cmp $r->the_request, "GET $base_uri$path_info­?$args
HTTP/1.0",
'$r->the_request';

+ {
+ my $new_request = "GET $base_uri$path_info­?$args&foo=bar
HTTP/1.0";
+ my $old_request = $r->the_request($ne­w_request);
+ ok t_cmp $r->the_request, $new_request, '$r->the_request rw';
+ $r->the_request($ol­d_request);
+ }
+
ok $r->filename;

my $location = '/' .
Apache::TestRequest­::module2path(__PACK­AGE__);
Index: docs/api/Apache2/Re­questRec.pod
===================­====================­====================­========
--- docs/api/Apache2/Re­questRec.pod (revision 500867)
+++ docs/api/Apache2/Re­questRec.pod (working copy)
@@ -1753,12 +1753,15 @@
First HTTP request header

$request = $r->the_request();
+ $old_request = $r->uri($new_reques­t);

=over 4

=item obj: C<$r>
( C<L<Apache2::Reques­tRec object|docs::2.0::a­pi::Apache2::Request­Rec>> )

+=item opt arg1: C<$new_request> ( string )
+
=item ret: C<$request> ( string )

For example:
Index: xs/maps/apache2_str­uctures.map
===================­====================­====================­========
--- xs/maps/apache2_str­uctures.map (revision 500867)
+++ xs/maps/apache2_str­uctures.map (working copy)
@@ -12,7 +12,7 @@
< next
< prev
< main
-< the_request
+ the_request
assbackwards
~ proxyreq
< header_only
Add comment
Geoffrey Young 8 February 2007 00:50:51 permanent link ]
 Fred Moyer wrote:> Greetings,> > Based on the thread here:> > http://marc.theaims­group.com/?l=apache-­modperl-dev&m=117002­875014012&w=2> > I've put together a diff to make $r->the_request writeable. I've based> this on the writeable test for $r->hostname. The test passes on my setup.> > Any suggestions on changes to this, or should I go ahead and commit it?

looks fine to me. I'd give it a day or two to marinate so others can
weigh in (if they choose to) then commit it. I'll give it an official
test-drive tomorrow.

--Geoff
Add comment
 

Add new comment

As:
Login:  Password:  
 
 
  
 
Пожалуйста, относитесь к собеседникам уважительно, не используйте нецензурные слова, не злоупотребляйте заглавными буквами, не публикуйте рекламу и объявления о купле/продаже, а также материалы нарушающие сетевой этикет или УК РФ.


QAIX > Apache HTTP Server > [patch] make $r->the_request writable 8 February 2007 00:50:51

see also:
is this a bug in PHP4?
strange question
include PHP into html page?
пройди тесты:
see also:
THE DAYS I’LL ALWAYS CHERISH AND KEEP…
THIS IS ONE MAIL THAT BRINGS TEARS TO…
LOVE KNOWS NO BOUNDS-I SACRIFICED…

  Copyright © 2001—2008 QAIX
Idea: Miсhael Monashev
Помощь и задать вопросы можно в сообществе support.qaix.com.
Сообщения об ошибках оставляем в сообществе bugs.qaix.com.
Предложения и комментарии пишем в сообществе suggest.qaix.com.
Информация для родителей.
Write us at:
If you would like to report an abuse of our service, such as a spam message, please .