cgi.lsp hanging while reading from stdin
Posted: Sun Sep 23, 2007 10:46 pm
I don't really know much about this subject, so please forgive me if I'm talking rubbish.
I'm been having problems getting a newlisp cgi script to run (using Apache on FreeBSD, I think). When the cgi.lsp runs, it seems to do a (set 'inline (read-line)). This means that it waits for input, doesn't it? And the script was hanging waiting for stdin input.
Anyway, someone suggested "Why don't you check the proper environment variable to see if it's a POST request first? Then if it was a GET, you wouldn't hang reading data from STDIN." A quick bypass like this got basic cgi operations working:
However, this appears to prevent any POST requests from getting through.
So, how to avoid waiting for read-line yet get any POST requests that are waiting?
Does any of this make sense? :-)
I'm been having problems getting a newlisp cgi script to run (using Apache on FreeBSD, I think). When the cgi.lsp runs, it seems to do a (set 'inline (read-line)). This means that it waits for input, doesn't it? And the script was hanging waiting for stdin input.
Anyway, someone suggested "Why don't you check the proper environment variable to see if it's a POST request first? Then if it was a GET, you wouldn't hang reading data from STDIN." A quick bypass like this got basic cgi operations working:
Code: Select all
(if (!= params nil)
(begin
(set 'inline (read-line))
(if inline
(set 'params (get-vars inline)))))
So, how to avoid waiting for read-line yet get any POST requests that are waiting?
Does any of this make sense? :-)