diff --git a/src/ssl.c b/src/ssl.c index d7b7243..1e4c6c4 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -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; } diff --git a/src/ssl.lua b/src/ssl.lua index 8ea2b2b..edc0862 100644 --- a/src/ssl.lua +++ b/src/ssl.lua @@ -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