# HG changeset patch # User Florian Zeitz # Date 1360523562 -3600 # Node ID eae665bc21223b507e90ec6e7c583a52f3c69f2c # Parent 7648ee2d59d1c15aba772a568fbaaefe0365bd8a mod_websocket: Fix require to work with lua-bitop (Thanks István and Zash) diff -r 7648ee2d59d1 -r eae665bc2122 mod_websocket/mod_websocket.lua --- a/mod_websocket/mod_websocket.lua Mon Feb 04 01:36:41 2013 +0100 +++ b/mod_websocket/mod_websocket.lua Sun Feb 10 20:12:42 2013 +0100 @@ -13,7 +13,10 @@ local softreq = require "util.dependencies".softreq; local portmanager = require "core.portmanager"; -local bit = softreq"bit" or softreq"bit32" or module:log("error", "No bit module found. Either LuaJIT 2 or Lua 5.2 is required"); +local bit; +pcall(function() bit = require"bit"; end); +bit = bit or softreq"bit32" +if not bit then module:log("error", "No bit module found. Either LuaJIT 2, lua-bitop or Lua 5.2 is required"); end local band = bit.band; local bxor = bit.bxor;