Claudio Fleiner wrote:
> 
> Hi Paul,
> 
> I was thinking of doing something similar. I have some problems with
> realvideo links that open the real video plugin instead of the standalone
> program, and I'd prefer the standalone. With this I could just replace
> those particular links.
> 
> Could you please send me the patches? I'll definitly try them out.
> 
> Thanks, Claudio
> 

Hi Claudio,

It sounds like an interesting problem. I not quite sure yet how you would solve
it with a script running under my WWWOFFLE extension, but if you get it to work,
I definitely want to know about it.

I've included a patch file with this message. To make the patch, I have
extracted only those changes I made to the source that are necessary to execute
scripts. I've tested the patch by patching the original wwwoffle-2.6d source
code with it and compiling the result, but I haven't tested the resulting
executable.
To execute a script under this extension, you must place it somewhere in the
/var/spool/wwwoffle/html/local directory and give the file execution permissions
(including execution by others). You must make sure that no other files in this
directory have (unintentional) execution permissions, or you could get some
strange results. (For this reason I will probably limit the scope of my wwwoffle
extension to a special directory in the future.)

The following information is passed on to the script:
One argument containing the url that was originally requested. (This is still a
leftover from the first crude version I made, in the future I will probably put
this information in the environment variable REQUEST_URI.)
The rest of the information is passed in environment variables.
SCRIPT_NAME contains the path of the script (with respect to the root
/var/spool/wwwoffle/html), e.g. /local/bin/foobar.pl.
REQUEST_METHOD contains the original request method (the only supported method
at present is GET).
HTTP_HOST contains the host part of the original url.
PATH_INFO contains the path part of the original url.
QUERY_STRING contains the arguments (aka the query) of the original url.
In addition to these, the header lines received from the client, if any, are
placed into the environment with the prefix HTTP_ followed by the capitalized
header name. Any - characters in the header name are changed to _ characters.

The output of the script must be a complete HTTP response, including headers. As
an example I've included a small perl module with subroutines to generate
responses, but you will probably want to adapt these before using them.

If your script detects an error, it should either print an HTML error message
and exit with status 0 or 1, or it should print nothing to stdout and exit with
status greater than 1. If a script terminates with non-zero exit status, this
will be noted in your logfile(s).

Good luck and let me know if it works.

-- 
Paul A. Rombouts <[EMAIL PROTECTED]>
Vincent van Goghlaan 27
5246 GA  Rosmalen
Netherlands

Attachment: wwwoffle-2.6d-execfile-patch.gz
Description: GNU Zip compressed data

Attachment: HTMLmessages.pm.gz
Description: GNU Zip compressed data

Reply via email to