proper socket invalidation #70

This commit is contained in:
Bruno Silvestre 2017-03-31 14:32:35 -03:00
parent 67a2133e7d
commit 9f6d623ccb
2 changed files with 5 additions and 1 deletions

View File

@ -848,5 +848,9 @@ LSEC_API int luaopen_ssl_core(lua_State *L)
luaL_newlib(L, funcs);
lua_pushstring(L, "SOCKET_INVALID");
lua_pushnumber(L, SOCKET_INVALID);
lua_rawset(L, -3);
return 1;
}

View File

@ -120,7 +120,7 @@ local function wrap(sock, cfg)
local s, msg = core.create(ctx)
if s then
core.setfd(s, sock:getfd())
sock:setfd(-1)
sock:setfd(core.SOCKET_INVALID)
registry[s] = ctx
return s
end