Re: How to simple exit in CGI?

<[email protected]> Tue, 28 Mar 2017 15:21:15 +0000
Newsgroups gmane.lisp.clisp.general
Message-ID <dd0e122d21564d52933fb2ea048f81f1@HE104834.emea1.cds.t-internal.com>
Hi,

Jean Louis wrote:
>>On Tue, Mar 28, 2017 at 02:32:48AM +0200, Pascal Bourguignon wrote:
> You should print out HTTP headers.  You can use them to report some status.
>Thank you. Sure, I am sending headers when necessary. If not necessary,
>in case of direct call to CGI, I like to send the redirect.

Please explain "in case of direct call to CGI"?
IMHO, you should learn the HTTP protocol, either version 1.0 (1996)
https://tools.ietf.org/html/rfc1945
or 1.1 (1999) or perhaps HTTP/2 (2015).
There's no "when necessary". You MUST always return headers. It is ALWAYS necessary.
(Except with HTTP "0.9", 26 years ago).

>        (query (or (getenv "QUERY_STRING")
Please explain your setup. Obviously CLISP is not the web-server front end
(otherwise there would be no such environment variables).
What is your web-server (Apache?)
and how is it configured to run CLISP (mod_fcgi for FastCGI)?

You need to read the documentation about how your web-server front end
invokes the CGI executables. Then you will know what to expect from the command line,
environment variables and/or standard input.


>yet if I don't send any parameters, I get displayed:
>*** - Ctrl-C: User break
>Break 1 [1]>
>I would like to understand what is happening.

Me too, yet your configuration is completely unclear to me. When I ran CLISP behind
Apache many years ago, I'd never see a ^C in any Apache log, nor a command prompt.
How is CLISP started in your setup?

If you want one CLISP memory image to be both useable from the command line
and when invoked from Apache as a cgi-bin, you need to take different path
of execution, after detecting whether the program was called in a CGI environment.

Regards,
	Jörg Höhle
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
clisp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/clisp-list