This is a discussion on Re: A question about wiring up filehandles for direct dump to HTTP - modperl ; Michael Peters wrote: > Victor Danilchenko wrote: > >> Is there any way, to, uhhh, tell Apache programatically to simply >> slurp up the file from an open filehandle > > I could be wrong, but I doubt you can ...
Michael Peters wrote:
> Victor Danilchenko wrote:
>> Is there any way, to, uhhh, tell Apache programatically to simply
>> slurp up the file from an open filehandle
> I could be wrong, but I doubt you can pass a Perl file handle to a C program
> that is not Perl aware (like Apache).
I am hoping you are wrong, but I am not expecting it. To be honest, I
kinda figured that there would be no easy and perfect way around it.
>> or to grab a given file from
>> disk? Doing a redirect to the real location is less than ideal precisely
>> because that will open a door to the circumvention of this accounting
>> script, a door which will be rather hard to close.
> What about an internal redirect? It won't expose where the door is and you can
> make it such that access to that URL is forbidden to any request not coming from
> your machine.
Huh, I didn't even realize this was possible. $r->internal-redirect,
eh? That sounds just like what I need -- coupled with some form of
hotlink protection, it should do the job. Thanks a lot.
> But the best approach seems to convert your code into an Apache Authen or Authz
> handler to do all the book keeping. Then simply let Apache continue with the
> processing after that. You'd probably have to ditch Mason for that piece of the
> code, but it's pretty straight forward.
If you are familiar with Apache internals, I am sure it is. i am not.
Unfortunately, this happens to be one of those "the roof is on fire"
deals -- I have to not only solve this problem, but solve it *fast*.
Many thanks for your immensely helpful advice. I think the internal
redirect is close enough to what I need to be useful. once again, thanks.
Senior Software Engineer, AskOnline.net
email@example.com - 617-273-0119