Re: How to simple exit in CGI?

Jean Louis <[email protected]> Thu, 30 Mar 2017 20:04:55 +0300
Newsgroups gmane.lisp.clisp.general
Message-ID <[email protected]>
Thank you for helping.

I found solution, as jasom on IRC, told me to check for
*standard-input* by using listen.

So, now I can run the CGI without POST and without GET parameters, and
without getting blocked, as Lisp is not waiting any more.

In the mean time I am learning ASDF.

Jean

(load "/home/data1/protected/lisp/quicklisp.lisp")
(ql:quickload "alexandria")

(defun main (&optional (arguments *args*))
  (if (listen *standard-input*)
    (progn 
      (headers)
      (print "Standard input here"))
    (progn
      (headers)
      (print "No standard input")))
  
  ;; (declare (ignore arguments))
  ;; (unless (listen *standard-input*)
  ;;   ;;              (getenv "QUERY_STRING"))
  ;;   (let ((url "http://localhost")
  ;;         (query (or (getenv "QUERY_STRING")
  ;;                    (alexandria:read-stream-content-into-string *standard-input*))))))
  ;; (format t "Status: 302 Found~%Location: ~a~%~%" url)

  (finish-output)
  (exit 0))

------------------------------------------------------------------------------
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