[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Strange experiences with coroutines while using Copas
- From: Eric Jacobs <eric@...>
- Date: Mon, 22 Aug 2005 03:09:38 -0500
On Sun, 21 Aug 2005 21:43:56 -0700
Chris Pressey <email@example.com> wrote:
> local chunk, err = skt:receive(chunk_size)
I don't know if this is the problem, but Copas doesn't seem to
handle this case correctly if there aren't at least 'chunk_size'
bytes available on the socket to read. It asks for an additional
'chunk_size' bytes after the partial read, which is incorrect and
may cause you to read past the next packet boundary if enough
data is available.
This could also be considered a bug in LuaSocket (if it should
count the results of the previous read as part of the current
read); maybe the API needs to be hammered out a bit more?