chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Hang problem with the http egg.


From: Robin Lee Powell
Subject: Re: [Chicken-users] Hang problem with the http egg.
Date: Wed, 12 Mar 2008 08:45:31 -0700
User-agent: Mutt/1.5.17+20080114 (2008-01-14)

On Wed, Mar 12, 2008 at 08:22:48AM -0700, Robin Lee Powell wrote:
> If something is choking on the lack of newline, it's in the http
> egg.

Except apparently not; apparently it's quite a bit lower-level than
that.  Here's some code I added:

(let loop ()
  (format #t "eof: ~A.\n" (eof-object? input))
  (format #t "ready: ~A.\n" (char-ready? input))
  (format #t "peek-char: ~A.\n" (peek-char input))
  (cond
    [(eof-object? input) noop]
    [(format #t "read-char: ~A.\n" (read-char input))
     (loop)]))

What's happening is that eof never returns true, even though the
port is closed.  ready returns #f, and the next operation (either
peek-char or read-char, I've tried both) hangs.

Here's the output:

eof: #f.
eof: #f.
ready: #t.
peek-char: O.
read-char: O.
eof: #f.
ready: #t.
peek-char: K.
read-char: K.
eof: #f.
ready: #t.
peek-char: ,.
read-char: ,.
eof: #f.
ready: #t.
peek-char: 3.
read-char: 3.
eof: #f.
ready: #t.
peek-char: 3.
read-char: 3.
eof: #f.
ready: #t.
peek-char: 9.
read-char: 9.
eof: #f.
ready: #t.
peek-char: 8.
read-char: 8.
eof: #f.
ready: #t.
peek-char: 4.
read-char: 4.
eof: #f.
ready: #t.
peek-char: 3.
read-char: 3.
eof: #f.
ready: #f.
[hangs here]

I don't know why eof never returns true, but I guess the tcp
connection is still open behind the port.  Closing the port first
just results in the read failing right away.

I'm kind of stuck at this point; I can make my own string collector
that stops when char-ready? is #f, but there seems to be a more
general problem here.

-Robin

-- 
Lojban Reason #17: http://en.wikipedia.org/wiki/Buffalo_buffalo
Proud Supporter of the Singularity Institute - http://singinst.org/
http://www.digitalkingdom.org/~rlpowell/ *** http://www.lojban.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]