[Ecls-list] bug in ecl_read_byte8, ecl_read_char and ecl_peek_char

Dmitry Statyvka dstatyvka at gmail.com
Fri Dec 12 14:59:46 UTC 2008


Hi.
I'm trying to use hunchentoot with ecl under windows and I've
encountered with infinte looping in the chunga:read-line* function.
After a lot of debug I came to the conclusion that there are bug in
ecl_read_byte8.

According to documentation  of the recv function, if the connection
has been gracefully closed, the return value is zero.  But
ecl_read_byte8, ecl_read_char and ecl_peek_char (functions that calls
recv) does check the return value on equality to SOCKET_ERROR only.

A solution is to switch between three cases: recv returns 0, 1 or
SOCKET_ERROR and to return the read character, end-of-file marker or
to raise an error respectively.

The attachment contains a corresponding patch.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ecl-winsock.patch
Type: application/octet-stream
Size: 1892 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20081212/bcbe4c20/attachment.obj>


More information about the ecl-devel mailing list