What is "My links" and what are they for?
[PATCH] Apache2::RequestIO::read bugfix + enhancements
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] Apache2::RequestIO:­:read bugfix + enhancements 30 July 2008 20:48:14

  Recent blog posts: 
  They have birthday today: 
  Forums:   
  Discuss: 
  Recent forum topics: 
  Recent forum comments:
  Moderators:

[PATCH] Apache2::RequestIO:­:read bugfix + enhancements

Torsten Foertsch 30 July 2008 20:48:14
 Hi,

it began with an innocent cycle to read the request body:

1 while( do{my $l=$r->read($conten­t, 8000, $where); $where+=$l; $l} );

Surprisingly $content was an empty string while $where said that some data was
read. I found that Apache2::RequestIO:­:read resets the passed buffer when end
of file is read that means if modperl_request_rea­d() returns 0.

Then I thought to remove these 2 XXX lines. And then what would happen in
these situations:

$content=123456;
$r->read($content, 100, 3);

or

"....."=~/(.*)/;
$r->read($1, 100);

Please review.

Torsten


-------------------­--------------------­--------------------­----------
To unsubscribe, e-mail: dev-unsubscribe@per­l.apache.org
For additional commands, e-mail: dev-help@perl.apach­e.org
Add comment
Philip M. Gollucci 18 July 2008 06:47:03 permanent link ]
 Torsten Foertsch wrote:
Please review.
+ /* use the same error message as perl core's read() */
+ Perl_croak(aTHX_ "Negative length");
It possible someone is regexing $@ against the previous string. Do you
really need to change the message ?


+ /* modperl_request_rea­d can return only >=0. So it's save to do
this. */
+ /* if total==0 we need to set the buffer length in case it is larger */


s/save/safe/


By any chance have you tried mod_apreq2 perl glue on top of this patch ?

+1


--
-------------------­--------------------­--------------------­-------------
Philip M. Gollucci (philip@ridecharge.­com)
o:703.549.2050x206
Senior System Admin - Riderway, Inc.
http://riderway.com­ / http://ridecharge.c­om
1024D/DB9B8C1C B90B FBC3 A3A1 C71A 8E70 3F8C 75B8 8FFB DB9B 8C1C

Work like you don't need the money,
love like you'll never get hurt,
and dance like nobody's watching.
Add comment
Torsten Foertsch 30 July 2008 20:48:14 permanent link ]
 On Fri 18 Jul 2008, Philip M. Gollucci wrote:
Torsten Foertsch wrote:
Please review.
+ /* use the same error message as perl core's read() */
+ Perl_croak(aTHX_ "Negative length");
It possible someone is regexing $@ against the previous string. Do
you really need to change the message ?

I doubt it but of course not.

+ /* modperl_request_rea­d can return only >=0. So it's save to do
this. */
+ /* if total==0 we need to set the buffer length in case it is
larger */
s/save/safe/

thanks

By any chance have you tried mod_apreq2 perl glue on top of this
patch ?

Current SVN passed all tests. So, I committed that stuff.

Torsten

--
Need professional mod_perl support?
Just hire me: torsten.foertsch@gm­x.net
Add comment
 

Add new comment

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


QAIX > Apache HTTP Server > [PATCH] Apache2::RequestIO:­:read bugfix + enhancements 30 July 2008 20:48:14

see also:
grabbing arguments at the command line
Programming by PHP
Installing PHP in WinNT and Apache 1.3
пройди тесты:
see also:
VoIP Internet Service
RSIDLL32.DLL
Handpunch

  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 .