Aaron B. wrote
On Thu, 23 Oct 2014 06:38:45 +0000
Thijs Schreijer <
thijs@
> wrote:
Does anyone have (a pointer to) some examples implementing this (copas
with luasec, or just luasec used non-blocking)?
I remember it being surpisingly simple to get LuaSec and Copas to play
nice. In short, just call ssl.wrap() inside your handler function.
I needed it working for a project once, and it looks like my patch was
applied:
https://github.com/lipp/tango/blob/master/tango/server/copas_socket.lua
--
Aaron B. <
aaron@
>
Took me a while, but got into this matter rather deep. From this line [1],
it seems to me that it does not do non-blocking ssl. The timeout has a
default of 10 seconds, which means that it still might block for 10 seconds.
The LuaSec ssl wrapper will return "wantread" or "wantwrite" on a
non-blocking socket, which doesn't seem to be handled in the code. So from
what I see, the timeout is high enough to not encounter it... (but hence it
is blocking)
Or am I missing something?
Thijs
[1]
https://github.com/lipp/tango/blob/master/tango/server/copas_socket.lua#L22
--
View this message in context: http://lua.2524044.n2.nabble.com/using-Copas-with-LuaSec-non-blocking-ssl-tp7663632p7666106.html
Sent from the Lua-l mailing list archive at Nabble.com.