perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geoffrey Young <ge...@modperlcookbook.org>
Subject updating r->finfo on $r->filename($newfile)
Date Mon, 27 Oct 2003 19:17:41 GMT
hi all

just following up on a thread in new-httpd from the weekend :)

in mp1, whenever a user set the filename via $r->filename($newfile) mod_perl 
would update r->finfo as well.  the reason is because things like 
default_handler do this

         ap_update_mtime(r, r->finfo.mtime);
...
         ap_set_content_length(r, r->finfo.size);
         if ((errstatus = ap_meets_conditions(r)) != OK) {
...

so, if a handler sets r->filename after translation, the wrong value will be 
used in the meets_conditions test, and the client will get bad data.

the attached patch carries this over to mp2.

the only outstanding issue for me is that in mp1, there was an exception for 
Win32, which I didn't carry over, figuring apr now takes care of the compat 
issues.  I'm also hoping that utime (used in the test suite) is portable :) 
  so, I'd like to get some feedback/test results from Win32 before porting 
this functionality to mp2.

--Geoff

Mime
View raw message