lua-users home
lua-l archive

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

On Sun, 21 Aug 2005 21:43:56 -0700
Chris Pressey <> 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?