comparison mod_auth_dovecot/auth_dovecot/sasl_dovecot.lib.lua @ 2798:e9ca7fd4ad06

mod_auth_dovecot: Support new luasocket unix domain socket API (fixes https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=852250 in Debian Stretch)
author Waqas Hussain <waqas20@gmail.com>
date Sat, 14 Oct 2017 23:04:02 -0400
parents a573d64968e9
children afeb06e4cdea
comparison
equal deleted inserted replaced
2797:44e5adbb6ac0 2798:e9ca7fd4ad06
24 local t_concat = table.concat; 24 local t_concat = table.concat;
25 local m_random = math.random; 25 local m_random = math.random;
26 local tostring, tonumber = tostring, tonumber; 26 local tostring, tonumber = tostring, tonumber;
27 27
28 local socket = require "socket" 28 local socket = require "socket"
29 pcall(require, "socket.unix"); 29
30 local unix_success, unix = pcall(require, "socket.unix");
31 if unix_success and unix and not socket.unix then
32 -- COMPAT map new luasocket API to old
33 socket.unix = unix.stream or unix.tcp;
34 end
35
30 local base64 = require "util.encodings".base64; 36 local base64 = require "util.encodings".base64;
31 local b64, unb64 = base64.encode, base64.decode; 37 local b64, unb64 = base64.encode, base64.decode;
32 local jid_escape = require "util.jid".escape; 38 local jid_escape = require "util.jid".escape;
33 local prepped_split = require "util.jid".prepped_split; 39 local prepped_split = require "util.jid".prepped_split;
34 local nodeprep = require "util.encodings".stringprep.nodeprep; 40 local nodeprep = require "util.encodings".stringprep.nodeprep;