Comments on: CGI requires content-length
I've noticed that various Rebol CGI website scripts hang. Apparently, HTTP POST on newer servers (or clients actually) keeps the socket open in such a way that the standard read-cgi function hangs.
The fix I use in newer scripts is to use the CGI content-length field to terminate the read.
If you have insights into this problem, please comment. I'd like to fix read-cgi in the next release.
You can disable persistent connections with:
added to the HTTP headers. See:
I guess servers now default to HTTP/1.1 at least and assume CGI scripts can handle that (though... it seems strange that the would on good old CGI... I wonder if there's something else going on).
Note also that you can support keep alive connections on scripts even if you don't know the output Content-Length in advance using the chunked transfer encoding:
Post a Comment:
You can post a comment here. Keep it on-topic.