[iolib-devel] Bug when using READ-LINE on non-blocking fds

Stelian Ionescu stelian.ionescu-zeus at poste.it
Sat Feb 7 19:49:36 UTC 2009


On Sun, 2009-02-08 at 00:48 +0530, Chaitanya Gupta wrote:
> Hi,
> 
> Iolib behaves in the following way when using READ-LINE with a 
> non-blocking fd:
> 
> ;; *client-stream is the stream associated with a client connected to 
> our server
> 
> IRCD> *client-stream
> #<active IPv6 stream socket connected to ::ffff:127.0.0.1/41460 
> {1004D5D451}>
> 
> IRCD> (fd-non-blocking *)
> T
> 
> ;; client sends the string "foo" down the socket, no newline is sent
> 
> IRCD> (ignore-errors (read-line *client-stream))
> NIL
> #<System-Error EWOULDBLOCK(11) "Resource temporarily unavailable">
> 
> ;; client sends the string "bar", followed by a newline
> 
> IRCD> (ignore-errors (read-line *client-stream))
> "bar"
> NIL
> 
> So, essentially, the string "foo" is lost. Shouldn't the correct 
> behaviour be to wait till a newline arrives on the socket?

That's correct. Thanks for the notice, I've just pushed a fix ;)

-- 
Stelian Ionescu a.k.a. fe[nl]ix
Quidquid latine dictum sit, altum videtur.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: <https://mailman.common-lisp.net/pipermail/iolib-devel/attachments/20090207/d5b0780c/attachment.sig>


More information about the iolib-devel mailing list