aboutsummaryrefslogtreecommitdiffstats
path: root/net/websocket/frames.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2015-10-06 16:26:23 +0200
committerKim Alvefur <zash@zash.se>2015-10-06 16:26:23 +0200
commit0cd290671aee99100d0ca323b87ca4e62bb310cb (patch)
tree90c9d8b736a30632cbaef9c5948fc44994f7d467 /net/websocket/frames.lua
parente0db9dc96086f51c68bf8c7ed55fb166dc5a5e83 (diff)
downloadprosody-0cd290671aee99100d0ca323b87ca4e62bb310cb.tar.gz
prosody-0cd290671aee99100d0ca323b87ca4e62bb310cb.zip
net.websocket.frames: Throw an error if no bit lib is found
Diffstat (limited to 'net/websocket/frames.lua')
-rw-r--r--net/websocket/frames.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/websocket/frames.lua b/net/websocket/frames.lua
index 23f18437..2ff30736 100644
--- a/net/websocket/frames.lua
+++ b/net/websocket/frames.lua
@@ -10,8 +10,8 @@ local softreq = require "util.dependencies".softreq;
local log = require "util.logger".init "websocket.frames";
local random_bytes = require "util.random".bytes;
-local bit = softreq"bit" or softreq"bit32";
-if not bit then log("error", "No bit module found. Either LuaJIT 2, lua-bitop or Lua 5.2 is required"); end
+local bit = assert(softreq"bit" or softreq"bit32",
+ "No bit module found. Either LuaJIT 2, lua-bitop or Lua 5.2 is required");
local band = bit.band;
local bor = bit.bor;
local bxor = bit.bxor;