[REBOL] Re: read bug?
From: holger:rebol at: 2-May-2001 14:14
On Thu, May 03, 2001 at 08:14:22AM +1200, Graham Chiu wrote:
> Actually, Carl is correct. My problem is that reading a
> very long url ( cgi by url method ) kills 'read. I haven't
> been able to post a large enough amount of data to encounter
> the bug that you were experiencing. I was looking forward
> to it though :-)
Are you sure this is a REBOL-specific bug, i.e. does it work
correctly with Netscape, when using with GET (not POST) ?
My experience is that using very long URLs causes problems
with some web servers and web browsers (e.g. Netscape 4.x,
IIRC). We recently switched one of our internal CGI-based
systems over from GET to POST because with GET the combination
of Netscape and Apache caused problems with long URLs. As a
rule, FORMs should only use GET for small numbers of fields and
limited field content. Otherwise use POST.
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
[holger--rebol--com]