lua-users home
lua-l archive

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


Reviewing that thread, what probably happened is that I forgot to
commit the change that was proposed (a new configuration option to not
try to autoclose sockets) during the holidays. The issue does not
happen with Xavante because it has a 1-1 correspondence between
handlers and threads... which did not happen in Alexander's and
David's code, for different reasons (David opened a socket to a
different host in the handler, Alexander passed sockets between
handlers).

I have commited a change that only closes the socket if
copas.autoclose is true (the default for now). If you set it to false
remember that you will have to explicitly close any socket you open.
Sorry for it being a global variable for now. It is trivial to change
Xavante to not rely on autclose, so I do not have a problem with
changing the default to copas.autoclose = false.

--
Fabio Mascarenhas


On Tue, Apr 5, 2011 at 8:55 PM, Alexander Gladysh <agladysh@gmail.com> wrote:
> On Wed, Apr 6, 2011 at 01:40, David Given <dg@cowlark.com> wrote:
>> On 05/04/11 21:26, Fabio Mascarenhas wrote:
>> [...]
>
>> However, handler() is the main function of the coroutine, so the
>> coroutine will now terminate and return into the same _doTick() that had
>> skt=clientsocket. _doTick() now correctly detects that the coroutine has
>> terminated and tries to close the server socket. Unfortunately, it
>> assumes that the last thing it blocked on was serversocket, so it just
>> closes skt; which of course is the wrong socket.
>
> Looks like it is the same bug that I reported back in 2009:
>
> http://lists.luaforge.net/pipermail/kepler-project/2009-December/003875.html
>
> Alexander.
>
>