CGI POST Failure to read Stdin

Dave Cragg dcragg at lacscentre.co.uk
Thu Apr 8 03:36:21 EDT 2004


At 7:13 pm -1000 7/4/04, Sannyasin Sivakatirswami wrote:

>Then we dug out an old note from Scott Raney on this subject of POST
>failures where there was a lot of data being sent... but we had been
>experiencing this even on very small data uploads... and the  syntax in
>the CGI he sent for the fix reads:
>
>put empty into tIncomingData
>repeat until length(tIncomingData) >= $CONTENT_LENGTH
>     read from stdin until empty
>     put it after tIncomingData
>end repeat
>
>Jai Ganesha! That works... so, it is some very esoteric, obscure issue
>about  the way POST is being generated by the Rev client that requires
>this specific mode of reading stnIn in order to work, even though if
>you just used
>
>read from stnin untiil empty
>put it into tIncomingData
>
>it *will* work just fine if the POST string is sent by some other
>remote agent besides a remote Revolution app...
>
>but the following does *not* work.
>
>>  repeat while length(tIncomingData) <= $CONTENT_LENGTH
>>     read from stdin for $CONTENT_LENGTH
>>     put it after tIncomingData
>>  end repeat
>
>Don't ask "why" ;-)


Try with "<" instead of "<=". Otherwise it will loop forever as the 
length will never get higher than $CONTENT_LENGTH.

Once again, my apologies. My original typo caused the problem.

Cheers
Dave


More information about the use-livecode mailing list