# HG changeset patch # User Matthew Wild # Date 1377682532 -3600 # Node ID 0ae2c250f27499a91049794dded0b031512b61bb # Parent 0b6b33688b756442612e9794437cfafc7acf25ba mod_turncredentials: Use type-specific get_option() methods where appropriate, and pass in default values diff -r 0b6b33688b75 -r 0ae2c250f274 mod_turncredentials/mod_turncredentials.lua --- a/mod_turncredentials/mod_turncredentials.lua Wed Aug 28 10:31:15 2013 +0100 +++ b/mod_turncredentials/mod_turncredentials.lua Wed Aug 28 10:35:32 2013 +0100 @@ -6,10 +6,10 @@ local hmac_sha1 = require "util.hashes".hmac_sha1; local base64 = require "util.encodings".base64; local os_time = os.time; -local secret = module:get_option("turncredentials_secret") or false; -local host = module:get_option("turncredentials_host") or false -- use ip addresses here to avoid further dns lookup latency -local port = module:get_option("turncredentials_port") or 3478 -local ttl = module:get_option("turncredentials_ttl") or 86400 +local secret = module:get_option_string("turncredentials_secret"); +local host = module:get_option_string("turncredentials_host"); -- use ip addresses here to avoid further dns lookup latency +local port = module:get_option_number("turncredentials_port", 3478); +local ttl = module:get_option_number("turncredentials_ttl", 86400); if not (secret and host) then module:log("error", "turncredentials not configured"); return;