Hi list,

I have a problem with downloading this URL:
http://www.linuxtelephony.org/article.cgi?i=400&r=0

It seems the linuxtelephony.org returns something in the HTTP headers that I
cannot successfully  read with rebol. Here's my code (copy&paste into your
rebol shell, but watch out for line breaks):

REBOL []

; This is the URL: http://www.linuxtelephony.org/article.cgi?i=400&r=0

insert-this: "GET /article.cgi?i=400&r=0 HTTP/1.0^/Host:
www.linuxtelephony.org^/"

port: open/lines [
  scheme:   'tcp
  host:     "www.linuxtelephony.org"
  port-id:  80
]

print "[We send:]"
print form insert-this

insert port insert-this

header: make block! 10
while [ not empty? reply: first port ] [
  if none? reply [print "Break!" break]
    parse reply [
      [copy name [thru #":"] (name: load name) | copy name [to end] (print
form name)]
      [copy value to newline | copy value to end] (if value [append header
reduce [name value]])
    ]
  ]

either [ not empty? content: first port ] [content: copy port] [print
"EMPTY!"]

close port

print reduce [header content]

halt


===== End code


>From other servers, this code is OK, but this linuxtelephony.org URL always
crashes on me. Does anyone have a clue?

Thanks,
HY

PS. The server seems to run Apache with PHP4:

Server: Apache/1.3.33 (Unix) PHP/4.3.11-dev
X-Accelerated-By: PHPA/1.3.3r2
X-Powered-By: PHP/4.3.11-dev

Could this be a PHP bug?

--
Prætera censeo Carthaginem esse delendam

-- 
To unsubscribe from the list, just send an email to 
lists at rebol.com with unsubscribe as the subject.

Reply via email to