Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] Re: HTTP Post hits 4K limit?

From: gchiu:compkarori at: 23-Oct-2001 8:12

> Has anybody else noticed this? Any workarounds? >
Hi Bo, This is a FAQ :) The 20 in the code is probabaly redundant. ================================================ About the other problem, i.e. getting data from a POST request within a REBOL CGI script: keep in mind that read-io is a very-low-level read request that returns as soon as the OS returns something. The amount of data returned is not necessarily what was requested. It can be less. This is not a bug, it is by design. If you see a limit of around 4096 bytes then this is caused by how the OS clusters its data. What you need to do in a CGI script is loop until read-io returns 0, e.g. cgi-str: make string! 100000 while [0 < read-io system/ports/input cgi-str 100000] [] -- Holger Kruse ; # working code if system/options/cgi/request-method = "POST" [ len_post: ( 20 + load system/options/cgi/content-length ) post: make string! len_post while [0 < read-io system/ports/input post len_post ] [] do decode-cgi post ] -- Graham Chiu