[REBOL] Re: read bug?
From: gchiu:compkarori at: 3-May-2001 20:42
On Wed, 2 May 2001 14:36:27 -0700
[sterling--rebol--com] wrote:
> Let me know what you find out.
>
> Sterling
Hi,
Here's a script to illustrate the problem. I'm not sure
that my understanding of what 'read should be doing is
correct here.
The script dies when it attempts to do a read at 4109 chars
at pass 10. I get an error messsage:
** User Error: Error. ..... the url is printed out .. and
then
could not be
retrieved. Server response: HTTP/1.0 400 Bad Request
** Near: res: read join cgi urltest"
Since 'read is I thought just returning what the web server
is sending, why should 'read die if the remote cgi script
dies? Should it not just return the web server error
message?
rebol []
url-encode: func [
{URL-encode a string}
data "String to encode"
/local new-data normal-char c
] compose [
new-data: make string! ""
normal-char: (charset [
#"A" - #"Z" #"a" - #"z"
#"@" #"." #"*" #"-" #"_"
#"0" - #"9"
])
if not string? data [return new-data]
parse data [some [
copy c normal-char
(append new-data c) |
copy c skip
(append new-data reduce ["%" skip tail (to-hex 0 + first
c) -2])
]]
new-data
]
test: read http://www.compkarori.com/rwiki/test.r
cgi: http://www.compkarori.com/cgi-local/vidwiki2.r?wiki=test2.r&action=submit&wiki-text
lencgi: length? cgi
print "length of test string should be 2529 chars"
print join "length of test is " length? test
counter: 0
test: join test copy/part test 1712
forever [
counter: counter + 1
print join "at pass " counter
test: join test "A"
urltest: url-encode test
res: read join cgi urltest
print join "past chars = " ( lencgi + length? urltest )
]
--
Graham Chiu