2006/2/2, Graham Dumpleton <[EMAIL PROTECTED]>:
> Nicolas Lehuen wrote ..
> > Well, I thought that if the file was modified, we needed to open it
> > anyway, but you're right, that's optimising for a minority case. We
> > might as well use stat and open the file only if it has changed.
> >
> > I've wrote an alternative publisher a few months ago that overloaded
> > this behaviour in the module cache to use
> > req.finfo[apache.FINFO_MTIME] as the file modification time, thus
> > saving us a call to fstat or stat entirely. I've stopped using this
> > publisher because I thought that using the standard publisher was a
> > better way to see how we could improve it, but anyway, I could back
> > port this trick. If I don't get burned down by the flak I'm currently
> > getting on the Python 2.2 issue, that is ;).
>
> I'd rather you not use:
>
>   req.finfo[apache.FINFO_MTIME]
>
> for the same reasons I got you not to use it last time.
>
> This is because now that req.filename/req.path_info are both writable,
> it is possible for someone in their own handler to modify these values,
> thus overriding Apache's own decisions about what matched the URL
> and then explicitly invoke mod_python.publisher to service it. Because
> req.finfo is not updatable by a handler, it isn't possible for a handler
> to override it to make it consistent with changes to req.filename.

Uh, yeah, now I remember why we aren't using this. At one point we
were, but you raised that issue. Thanks, Graham. I should really not
be reading my mail so early in the morning.

Regards,
Nicolas

Reply via email to