W3C home > Mailing lists > Public > www-jigsaw@w3.org > September to October 1996

Re: Runaway CgiResource Problem

From: Anselm Baird-Smith <abaird@w3.org>
Date: Wed, 9 Oct 1996 08:44:47 -0400 (EDT)
Message-Id: <199610091244.IAA24828@anansi.w3.org>
To: "Bruce Nelson (bnelson)" <bnelson@www.css.filenet.com>
Cc: www-jigsaw@w3.org
Bruce Nelson writes:
 > The plot thickens...
 > 
 > It seems that the runaway is tied to how the CgiResource is set
 > up... if for example my interpreter is set to /usr/local/bin/perl
 > and my command is /usr/local/Jigsaw/Jigsaw/WWW/test.pl, (the script
 > is as follows) 
 > ---
 > 
 >   #!/usr/local/bin/perl
 > 
 >   print "Content-Type: text/html\n\n";
 >   print "Hello cruel World";
 >   exit(0);
 > 
 > ---
 > I get some very intresting results depending on the value of 
 > "generates-form".

Let me clarify what generates-form is for (BTW if you had 1.0alpha3,
you would have context sensitive help ;-) 
If true, it means that the script, when GET (no query string) wants to
generate the form, so the script is called, no parameters to generate
it. If set to false, the the CgiResource defaults to its superclass
FileResource, and act as as such.
For compatibility, generates-form defaults to true.

 > 
 > if "generates-form" = true I get the runaway script problem as described 
 > below.

You should say:
    
    print "Content-Type: text/html\r\n";

I am unsure if that causes the problem, but its worth a try. Also you
may want to try running Jigsaw in trace mode (by adding -trace to your
command line), this will dump all requests/replies.

 > if "generates-form" = false and content-type = text/html then a C application
 > works fine - no runaway but if I use the interpreter set to 
 > /usr/local/bin/perl and I set the command to test.pl I get the contents of my
 > script instead of its output, example:
 > 
 >   #!/usr/local/bin/perl
 > 
 >   print "Content-Type: text/html\n\n";   
 >   print "Hello cruel World";
 >   exit(0);
 > 
 > instead of Hello cruel World. very strange -- 
I hope the above explanation on generates-form has revealed the
mistery: here, the Cgiresource defaults to FileResource, because you
issue a GET with no query string, and the FileResource emits the
content of the script (it thinks it is the file to serve, because the
filename attribute is undefined)

Anselm.
Received on Wednesday, 9 October 1996 08:44:53 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 9 April 2012 12:13:25 GMT