Read from StnIn from POST is still broken?

Sivakatirswami katir at hindu.org
Fri Mar 3 21:48:19 EST 2006


This is a really old problem: Rev CGI scripts are truncating data  
piped from Apache from a POST....

Does anyone know for "positively absolutely" sure that new version of  
rev has over come this issue?

context:

Linux web server, Apache, call Rev CGI to receive incoming Post  
Data.  Beginning lines of script to read the incoming data -- see  
below (suggested as a possible fix years ago by Scott Raney)

(musings... it is possible that this is a client side problem?
--machine A with browser B cannot in fact encode large chunks of data  
and the name=value pair actually arrive to the server already  
truncated.. meanwhile
-- box C with browser D submits a large text chunk from the same form  
and it arrive just fine: result Rev get blamed for being intermittent  
failures... but he's really not the bad guy.

on startup
if $REQUEST_METHOD is "POST" then
	put "" into PostIn
	repeat until length(PostIn) >= $CONTENT_LENGTH
		read from stdin until ""
     		put it after PostIn
   	end repeat  	
	put  urlDecode (PostIn)  into tDataIn
	 	
	split tDataIn by "&" and "="
	put keys(tDataIn) into tFields

.....etc.

if one of the incoming name pairs contains too much data, it is  
truncated.

You can stress test this yourself:  go to:

http://www.himalayanacademy.com/teaching/stories/

and scroll down to the end of the list...the last "story is a  
submission with a large text chunk pasted into the main field.

The full cgi is here:

http://www.himalayanacademy.com/teaching/stories/incoming_stories.txt

Sivakatirswami












More information about the Use-livecode mailing list