Comparison

net/server_select.lua @ 12487:db634db8e069

net.server_select: Restore dependency on LuaSec to soft for tests server_select is used in e.g. storagemanager tests, and some of the CI runners are lacking LuaSec, which resulted in failures.
author Kim Alvefur <zash@zash.se>
date Wed, 27 Apr 2022 21:45:36 +0200
parent 12481:2ee27587fec7
child 12542:5ec9d6913162
comparison
equal deleted inserted replaced
12486:ee93df086926 12487:db634db8e069
45 local coroutine_wrap = coroutine.wrap 45 local coroutine_wrap = coroutine.wrap
46 local coroutine_yield = coroutine.yield 46 local coroutine_yield = coroutine.yield
47 47
48 --// extern libs //-- 48 --// extern libs //--
49 49
50 local has_luasec, luasec = pcall ( require , "ssl" )
51 local luasocket = use "socket" or require "socket" 50 local luasocket = use "socket" or require "socket"
52 local luasocket_gettime = luasocket.gettime 51 local luasocket_gettime = luasocket.gettime
53 local inet = require "util.net"; 52 local inet = require "util.net";
54 local inet_pton = inet.pton; 53 local inet_pton = inet.pton;
55 local sslconfig = require "util.sslconfig"; 54 local sslconfig = require "util.sslconfig";
56 local tls_impl = require "net.tls_luasec"; 55 local has_luasec, tls_impl = pcall(require, "net.tls_luasec");
57 56
58 --// extern lib methods //-- 57 --// extern lib methods //--
59 58
60 local ssl_wrap = ( has_luasec and luasec.wrap )
61 local socket_bind = luasocket.bind 59 local socket_bind = luasocket.bind
62 local socket_select = luasocket.select 60 local socket_select = luasocket.select
63 61
64 --// functions //-- 62 --// functions //--
65 63