Bobber Cheng wrote:
(gdb) p r->filename
$1 = 0x81a1818 "/usr/local/lxr/source"
(gdb) p r->finfo
$2 = {pool = 0x819fe80, valid = 7598448, protection = 1877,
  filetype = APR_REG, user = 48, group = 48, inode = 410325, device = 774,
  nlink = 1, size = 7123, csize = 1077577583, atime = 1068909622000000,
  mtime = 1027905783000000, ctime = 1068307947000000,
  fname = 0x81a1818 "/usr/local/lxr/source", name = 0x0, filehand = 0x1}

I found r->finfo.filehand always is 0 whether i refresh the page, the file must be open by apr_file_open() even it is 1. So i just do

(gdb) set r->finfo.filehand=0

(gdb) p r->filename
$4 = 0x81a5828 "/usr/local/lxr/source"
(gdb) p r->finfo
$5 = {pool = 0x81a3e90, valid = 7598448, protection = 1877,
  filetype = APR_REG, user = 48, group = 48, inode = 410325, device = 774,
  nlink = 1, size = 7123, csize = 1077577583, atime = 1068914748000000,
  mtime = 1027905783000000, ctime = 1068307947000000,
  fname = 0x81a5828 "/usr/local/lxr/source", name = 0x0, filehand = 0x0}

It works.

Here is what i changed:
--- src.bak/modules/perl/modperl_util.c 2003-11-16 00:10:57.351359624 +0800
+++ src/modules/perl/modperl_util.c     2003-11-16 00:17:50.310580280 +0800
@@ -712,6 +712,7 @@
         return newRV_noinc(sv);
     }

+    r->finfo.filehand = 0;
     file = r->finfo.filehand;
     if (!file) {
         rc = apr_file_open(&file, r->filename, APR_READ|APR_BINARY,

Well, that renders the check, whether the file was already opened, useless, in which case we should just:


rc = apr_file_open(...)

no matter what. I've now posted a question to the apr list asking how to verify whether finfo contains a valid filehandle or not. Depending on their answer we will either adjust the check to do the right thing, or unconditionally open that file.

Thanks for the debug, Bobber, I'll keep you posted as I'll have more information to tell.

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to