CGI input data disappearing

Started by Kirill, December 04, 2012, 03:28:04 AM

Previous topic - Next topic

Kirill

#15
Thank you, Lutz.


Quote from: "Lutz"Two things:



(1) I believe the version you diffed against is not the current 3.2 online - may be you have to hit refresh in your browser. See the position of the (set 'post-data "") statement, which has to come after the 'when'. This was the change from 3.11 to 3.2.


Yes, the diff was against 3.11, which did not work, and I did not notice that the said statement was moved from before 'when' to after 'when'.


Quote from: "Lutz"(2) When less data are in the channel than announced in CONTENT_LENGTH, the web.lsp version will throw an error when the 'inc' is fed a 'nil' increment. The cgi.lsp will simply stop reading. When CONTENT_LENGTH is too small cgi.lsp will continue reading. Both versions will work with correctly formatted requests, but cgi.lsp is more robust when less bytes are available than in CONTENT_LENGTH.


Maybe it is good to throw error when CONTENT_LENGTH does not correspond to available data?

Lutz

#16
QuoteMaybe it is good to throw error when CONTENT_LENGTH does not correspond to available data?


Yes, perhaps. But then also a response or error page should be formatted and sent back to the client. I guess in the real world, CONTENT_LENGTH will be ok most of the time and its not an issue to worry about. Almost always, CONTENT_LENGTH will be generated automatically by software.



I wonder how other web frameworks deal with these cases.