[REBOL] Re: html post
From: g:santilli:tiscalinet:it at: 8-Aug-2002 12:13
Hi Andrew,
On Thursday, August 8, 2002, 6:42:53 AM, you wrote:
AM> and so I know the length needed.
AFAIK READ-IO is not guaranteed to return the asked length; it
returns UP TO the asked length of data, but does not wait for it
to arrive if it is not there. (Anyone correct me if I don't recall
correctly; I no more used READ-IO after the NO-WAIT mode has been
introduced.)
AM> Let's hope there's something better soon. It's not very nice script at the
AM> moment.
READ-IO is basically the same as COPY on a BINARY/NO-WAIT port,
except for the need to allocate a properly sized buffer. So you
can replace you code with something like:
set-modes system/ports/input [binary: true no-wait: true]
data: copy system/ports/input
while [content-length > length? data] [
wait system/ports/input
insert tail data copy system/ports/input
]
(WARNING: not tested)
Regards,
Gabriele.
--
Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer
Amigan -- AGI L'Aquila -- REB: http://web.tiscali.it/rebol/index.r